How to print this date format: eg. 14-Aug-2002 01:26:36 PM?

Can anyone tell me exactly how to print this format?

This is how we can produce the output you specified.
import java.util.*;
import java.text.*;
//14-Aug-2002 01:26:36 PM?
class Test
     public static void main(String args[])
          //Date b=new Date();
          //System.out.println(b.toString());
          // Format the current time.
          SimpleDateFormat formatter = new SimpleDateFormat ("dd-MMM-yyyy ' ' hh:mm:ss a");
          Date currentTime_1 = new Date();
          String dateString = formatter.format(currentTime_1);
          System.out.println(dateString);
}//end of Test.

Similar Messages

  • How to get this date format

    Hi all,
    i have a very simple query.
    I have  report name like this "SALES REPORT DATE FOR "+Year(CurrentDate())
    and it is showing result of SALES REPORT DATE FOR 2,014
    but i want report look like SALES REPORT DATE FOR 2014
    how i can change the year format form 2,014 to 2014
    i am using 3.1
    Thanks in advance
    Ranjeet

    Hi
    Find the below link
    BI4.1 Business Layer Enhancements - Create Display Format

  • How to define the date format for this date string

    2006-11-13 00:00:00.0
    How to define the date format in control file for sqlldr. "yyyy-mm-dd hh24:mi:ss" or "yyyy-mm-dd hh24:mi:ss.FF1" does not work
    thanks,

    SQL> desc t
    Name                                      Null?    Type
    TS                                                 TIMESTAMP(6)
    SQL> !cat t.ctl
    load data
    into table t
    truncate
    (ts timestamp "YYYY-MM-DD HH24:MI:SS.FF1")
    SQL> !cat t.dat
    2006-11-13 00:00:00.0
    SQL> !sqlldr userid=scott/tiger control=t.ctl data=t.dat log=t.log
    SQL*Loader: Release 10.2.0.3.0 - Production on Fri Sep 7 11:19:28 2007
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 1
    SQL> select * from t;
    TS
    13-NOV-06 12.00.00.000000 AMBest regards
    Maxim

  • How to change the date format in xml form?

    hi,
    How to change the date format in xml form?
    For example:  11/20/2008 3:00:03 PM    ->   11-20 03:00
    Any opinions greatly appreciated!
    Thanks.
    Edited by: ke wenxing on Dec 2, 2008 8:33 AM

    You could go to System - User Profile - Own Data would take you to the "maintain user profile screen"
    Click the defaults button and change the date format.This changes date format for all the dates in your login.

  • How to change the date format  YYYYMMDD to MM/DD/YYYY

    Hi ,
    How to change the date format  YYYYMMDD to MM/DD/YYYY .
    Ex :  20071008  to 10/08/2007
    Is there any function module for this ??
    Regards
    Rahul

    Hi Sharma,
    check the code:
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
    PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X', "SAP date format YYYYDDMM
    date2 RADIOBUTTON GROUP rad1, "Date format like aprial31, 2006
    date3 RADIOBUTTON GROUP rad1, "Date format like 31 apr,2006
    date4 RADIOBUTTON GROUP rad1, "Date format like DD/MM/YYYY
    date5 RADIOBUTTON GROUP rad1. "Date format like DD.MM.YYYY
    SELECTION-SCREEN END OF BLOCK b2
    FORM getmonth .
    SELECT mnr
    ktx
    ltx
    INTO TABLE T_month
    FROM t247
    WHERE spras = 'EN'.
    IF sy-subrc NE '0'.
    MESSAGE I "Message - Not able to get month values from the table T247
    ENDIF.
    ENDFORM.
    DATA : temp_date(16) TYPE c,
    temp1_date(60) TYPE c,
    year(4) TYPE c,
    daymonth(11) TYPE c,
    daymonth1(11) TYPE c,
    month(9) TYPE c,
    day(2) TYPE c,
    mon LIKE t247-ktx,
    len TYPE i .
    MOVE date TO temp1_date .
    CONDENSE temp1_date NO-GAPS.
    MOVE temp1_date TO temp_date .
    IF date2 EQ 'X'. "The date format is like Aprial 31, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    _len = STRLEN( _daymonth1 ).
    l_len = 13 - len.
    SHIFT daymonth1 RIGHT BY len PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    SORT t_month BY monthltx.
    READ TABLE t_month WITH KEY monthltx = month.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    len = STRLEN( month ).
    CONDENSE daymonth NO-GAPS.
    SHIFT daymonth LEFT BY len PLACES.
    day = daymonth.
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date3 EQ 'X'. "The date format is like 31 apr, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT i_date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    SHIFT daymonth1 LEFT BY 2 PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    TRANSLATE month TO UPPER CASE.
    SORT t_month BY monthstx.
    MOVE month to mon.
    READ TABLE t_month WITH KEY monthstx = mon.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    CONDENSE daymonth NO-GAPS.
    day = daymonth+0(2).
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'. "Date format is like DD.MM.YYYY or DD/MM/YYYY
    CONDENSE temp_date NO-GAPS.
    IF STRLEN( temp_date ) EQ 10.
    o_date0(4) = temp_date6(4).
    o_date4(2) = temp_date3(2).
    o_date6(2) = temp_date0(2).
    ELSE.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ENDIF.
    ENDIF.
    IF STRLEN( o_date ) NE '8'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ENDIf.
    ENDFORM. " f0100_conv_date
    Reward if helpful.
    Regards,
    Harini.S

  • Is there any system variable for this date format 01/21/2004 18:00:32

    Hello,
    Is there any system variable for this date format 01/21/2004 18:00:32
    This is my Internal date format and my External date format is sy-datum.
    How can I validate....any suggestions will be apprecaited!
    Regards,
    Kittu

    Hello,
    Thank you very much for your response!
    My internal date format is 01/21/2004 18:00:32
    and external date format on selection-screen is sy-datum.
    My external format is stored in S_crtsp
    and internal format is stored in L_crtsp. (01/21/2004 18:00:32)
    I want to remove the time from the internal format and validate it aginst the external format.
    Any suggestions or brief explonation is appreciated...I apprecaite the help soo far...
    Regards,
    Kittu

  • How to set this DATS parameter

    Hi Pros,
            I am calling function 'HR_FORMS_TIM_GET_B2_RESULTS' in the program , its input parameter is BEGDA, I transfer a date variable to BEGDA, but does not work. can not get any data. but if I run this function in SE37, I input date '20140807', successfully get result.  please tell me how to set this DATS parameter?

    Hi,
    You might be passing the date in '12.12.2014' or '12/12/2014' format. Please
    use the function module 'CONVERSION_EXIT_BEGDA_INPUT' to convert the date
    to internal format and then pass it to the function module.
    Thanks

  • How to remove the date format validation done by the UI

    Hi All,
    I am having a date field which is an input field for Dateof Birth. User can either select from the calendar or enter his own date. If the user enters invalid date format'(032342525') something like this, when we move to the next tab the column turns to Red and it displays a message saying that date is not a valid date. I wanted to validate that on Save instead of tab click.
    Can anyone of you tell me how can we remove this date format validation in Java Webdynpro.
    Thankyou for your time and consideration!
    Madhavi

    Thankyou for your reply. I cannot the change the date type to string bcas the users need date picker to select the date. The problem I am having is once the format is wrong and the UI validates, though the other fields are entered by the user the application returns error saying that the required field are not entered.
    And also I am having multiple containers in my view set and for all other error messages I am using a popup to display the messages and this only error is shown at the bottom of the page which the users does'nt like.
    Is there any way I can identify that format error occured before it throws on the UI screen??
    Regards,
    Madhavi

  • How to change the date format?

    Hi,
    I need to display the data format as(YYYY-MM-DD). But now it displays(2009-1-9)
    Here is my code snippet which i used to display the data format as(2009-1-9)
    *<INPUT TYPE=TEXT NAME="date_submitted" MAXLENGTH=20 SIZE=10 VALUE="" onBlur= "return dateSubmitted()">  (YYYY-MM-DD)*
    *<SCRIPT LANGUAGE="javascript">*
    dateSubmitted()
    *</SCRIPT>*
    function dateSubmitted()
                        if (document.pgUpdate.date_submitted.value == "")
                             date = new Date();     
                             month = date.getMonth() + 1     
                             document.pgUpdate.date_submitted.value =
                                            date.getYear() + "-" + month + "-" + date.getDate();
                        return true;
    Can anybody help me how to change the date format?
    Thanks in advance!

    prit123 wrote:
    use SimpleDateFormat class. The code is :He posted a Javascript related question, not a Java related question.
    Please use forums devoted to Javascript. You're here at a Java/JSP forum.
    There are JS forums at webdeveloper.com and dynamicdrive.com. Good luck.
    String formatPattern = "yyyy-mm-dd";
    SimpleDateFormat sdf = new SimpleDateFormat(formatPattern);
    sdf.format(yourdate);yyyy-mm-dd denotes year-minutes-days. Please go read the SimpleDateFormat API as well.

  • HT4847 How i take an old back form my old iphone to my new iphone?!when i acces icloud from my phone and go to manage storage i have 4 back up for diferent phone how can acces this data?!

    How i take an old back form my old iphone to my new iphone?!when i acces icloud from my phone and go to manage storage i have 4 back up for diferent phone how can acces this data?!

    Thanks very much!
    Although I had to add everything again to the playlist, at least I can just copy it over in future!

  • How to print previous date as current date

    Hi ,
    how  to print  previous data as current date in output  with out any changes....

    Hi Degala Hari Krishna,
      Can you explain clear.

  • How can I parse this date format?

    Hey,
    i am trying to write an interface between two applications. One application gives me the following date:
         Wed Jul 16 12:18:20 CEST 2003
    but I need it to look like this:
         16.07.03 12.18:20
    I tryed to use Date and DateFormat to parse and change it but the Date was unparseable.
    I hope somebody can point me to the right direction or show me how I can do the formating.
    Thanx a lot!
    Martin

    If this isn't a well-known date format, I can't see any solution but to write small function yourself which doe the job.
    you can start with :
    String source = "Wed Jul 16 12:18:20 CEST 2003";
    String[] elements = source.split();//splits source around spaces
    then you write functions that map day of week with numbers
    "Mon" --> 1
    "Tue" --> 2
    etc...
    it won't take you days to write this.
    Sometimes it's faster to write the stuff yourself than spending days looking for something pre-defined that may or may not exist.

  • How can i get this date format

    i want to convert my date format to
    YYMMDDHHMMSS
    so lets say
    select format_date (sysdate YYMMDDHHMMSS ) from dual
    out put
    090612040957
    help please
    Edited by: kama021 on Jun 13, 2009 9:05 AM
    Edited by: kama021 on Jun 13, 2009 9:06 AM

    Hi Kama, try these and spot the difference:
    MHO%xe>  select to_char(sysdate, 'YYMMDDHHMMSS') from dual
      2  /
    TO_CHAR(SYSD
    090613060625
    1 rij is geselecteerd.
    Verstreken: 00:00:01.21
    MHO%xe> --that was totally WRONG, use :
    MHO%xe> select to_char(sysdate, 'YYYYMMDDHHMISS') from dual
      2  /
    TO_CHAR(SYSDAT
    20090613060758
    1 rij is geselecteerd.
    edit
    Using 2 digits for century = soooooo 1970's....
    I suggest you read op on presenting dates here:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_sqltypes.htm#sthref442
    Edited by: hoek on Jun 13, 2009 6:10 PM

  • How to print some data in alv which is not in table.

    hi all,
    Please can any one tell me how to print some text in the existing alv program to the second line of every record.
    the header is there but it is empty.In the data,
    there are two lines printing for a normal alv.the same text should be  printed in every second line of each record.Please reply soon.its urgent.

    This is not possible in ALV.
    When you say some text I assume the text is not in the same columnar format as the list is.
    ALV supports only a columnar format (except for subtotals).
    You can add the text to the ITAB by parsing the text to the record. It is not going to look good if you do that.

  • PDF Print Forms - Date format

    Hi Frnds,
    This is my first time to work in PDF print forms.
    I am using standard interface and program to print my PDF forms. The PDF form alone is customised.
    I need to format my date as dd-mmm-yyyy. how can i do it?
    can i call a subroutine from a Zprogram in the context or interface?
    Can anyone help me to solve my issue? thanks a lot.
    regards
    Suganya.

    Hi Frnds,
    I got the date format solution.
    But I need to know whether we can use the subroutine of the program inside the interface or PDF forms as like script.
    I am using the std prgm RFKORD10_PDF and my customised PDF form. but i am getting an error as "Contradiction in form".
    Can anyone help me to solve the error?
    thank in adv
    Suganya

Maybe you are looking for

  • "error while printing" when saving

    A really odd thing started happening today: when I hit Apple + S to save a document, it first pops up the save progress box, but after a few seconds a 2nd box appears with a mesage saying "Print. error while printing." I'm just trying to save, not to

  • Change the size and viewing ratio

    Hello all I am trying to have a small two minute or three minute movie play on my web site, however the web software I use wont let me upload a movie any larger than 10 m. And you guessed it the original is 38m, so there for I would need to compress

  • Missing "Arrangement" tab in Display preferences

    Hi all, I hope this topic hasn't been discussed before, but I did search fo it and didn't find anything. I'm trying to display my "presenter display" content on my MBP (15") screen when using Keynote, and I take it the way to do that is to have the d

  • Geotagging is slow or not working on photos taken with iphone4

    I've taken 8 photos all with location services on. Only 3 photos have been tagged.

  • How to turn off ORA-31684 during impdp?

    when impdp a schema like: impdp emsuser/mypwd DIRECTORY=dmp_dir table_exists_action=replace DUMPFILE=$dmp schemas=emsuser got the ignorable annoying ora-31684. HERE ignore=y doesn't work anymore. Connected to: Oracle Database 10g Enterprise Edition R