How to print date in dd/MM/yyyy format??

Hi All,
I want to print a date in a dd/MM/yyyy format. I am doing like this
Date d = new Date(23-11-2006); but it is printing
like Wed Dec 31 18:59:58 EST 1969 .
Please help me .

I am doing like this
Date d = new Date(23-11-2006); but it is
printing No you're not, because that won't compile. Show us exactly what you're doing and we might be able to help.
You seem to suggest you want to print a date in a certain format, but then the (pseudo-) code you present seems to suggest you want to be able to parse a date from a given format into a Date object.
Be clear and specific about exactly what you want, what you have tried, and why it didn't work and then people will be better placed to help! :-)

Similar Messages

  • How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?

    Hi
    How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?
    This is my Input data.
    11/25/2007.
    By using below query, it is inserted into database.
    sql>Insert into tblname values(to_date('11/25/2007','MM/DD/YYYY'));
    But using stored procedure, the same query is not running.
    It shows error like
    ORA-01843: not a valid month ORA-06512: at line 1
    Procedure:
    create or replace procedure Date_Test(datejoin in DATE) is
    begin
    insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    end Date_Test;
    I had used 'nls_date_language = american' also.
    Prcodeure is created but not worked in jsp. The same error is thrown.
    Pls provide a solution

    This might help you....
    SQL> Create Table DateTest(col1 Date);
    Table created.
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    BEGIN Date_Test('11/25/2007'); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    BEGIN Date_Test(To_Date('11/25/2007','mm/dd/yyyy')); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at "CTBATCH.DATE_TEST", line 3
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(datejoin);
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> Select * from DateTest;
    COL1
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in VarChar2) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'mm/dd/yyyy'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select * from DateTest;
    COL1
    25-NOV-07
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL>

  • How to convert date  into dd mon yyyy format

    hi all,
    i have a problem in date format i am using date like below .
    <%java.util.Date date = new java.util.Date();%>
    i am inserting date into a table and its storing like this
    insert into tablename (d_date) values (date)
    and its inserting date like below
    Sun Oct 19 09:05:45 GMT+03:00 2003
    i want to fetch date in dd mon yyyy format.
    with this format i want to make a select query.i struck with the format conversion.
    how to do this.
    any comments please.
    any help

    hi all,
    i understand now where i am wrong.
    the below code is not working why because in my server where i am executing code the regional setting month value is in arabic.
    i executed the same code in a different server where date and time jones are english its working fine.
    All the problem is in regional setting and not the jsp code.
    <%
    String whtEverDateFormatYouWAnt = "dd MMM yy";
    String str = new SimpleDateFormat(whtEverDateFormatYouWAnt).format(new SimpleDateFormat("EEE MMM dd HH:mm:ss vvv yyyy").parse("Sun Oct 19 09:05:45 GMT+03:00 2003"));
    out.print(str);
    %>
    Thanks a lot for the excellent solution.
    Thanks again.

  • How to get date in dd/mm/yyyy format ?

    Hello,
    for this query :
    >select to_date(to_char(sysdate),'dd/mm/yyyy') from dual;
    i wanted to get date in dd/mm/yyyy format , but this query is not returning in correct date format .
    How to get that ?

    select id,
    to_date(to_char(dt1,'mm/dd/yyyy'),'dd/mm/yyyy') dt1,
    to_date(to_char(dt2,'mm/dd/yyyy'),'dd/mm/yyyy') dt2
    from t_table1 where no=23;This is my actual query.
    But this query is giving error.
    ORA-01843: not a valid monthWhen i issued this query :
    select id,dt1,dt2 from t_table1 where no=23 ;
    this is the output :
    ID DT1 DT2
    001 10/7/2011 10/19/2011Edited by: bootstrap on Oct 8, 2011 2:13 PM
    Edited by: bootstrap on Oct 8, 2011 2:13 PM

  • How to insert date in mmm/dd/yyyy format

    hi all,
    im getting date from user-interface in the format of mmm/dd/yyy.
    when i tried to insert data in this format,
    insert into temp values('10-july-2000);
    insert into temp values('july-10-2000');
    the first statement is working fine. and the second statement is givine msg,
    SQL> insert into temp values('10-july-1999');
    1 row created.
    SQL> insert into temp values('july-10-1999');
    insert into temp values('july-10-1999')
    ERROR at line 1:
    ORA-01858: a non-numeric character was found where a numeric was expected
    how to get this.
    regards
    pavan

    I have read that ALTER SYSTEM changes will be effective immediately and there is no need to bounce the database.
    right but if parameter is "modifiable" if not then we need to "restart database"
    there three parameter with "alter system .... cmd"
    1. Memory
    2. Spfile ------------effect in next startup
    3. Both ( Memory + spfile) Default
    hope this helps
    Let take example : PROCESSES is not modifiable parameter.
    SQL> show parameter process
    NAME                                 TYPE        VALUE
    processes                            integer     150
    SQL> alter system set processes = 152 scope=both
      2  /
    alter system set processes = 152 scope=both
    ERROR at line 1:
    ORA-02095: specified initialization parameter cannot be modified
    SQL> alter system set processes = 152 scope=memory
      2  /
    alter system set processes = 152 scope=memory
    ERROR at line 1:
    ORA-02095: specified initialization parameter cannot be modified
    SQL> alter system set processes = 152 scope=spfile;
    System altered.
    SQL> show parameter processes
    NAME                                 TYPE        VALUE
    processes                            integer     150
    SQL> startup force
    ORA-01031: insufficient privileges
    SQL> conn sys as sysdba
    Enter password:
    Connected.
    SQL> startup force
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    Database opened.
    SQL>
    SQL> show parameter processes
    NAME                                 TYPE        VALUE
    processes                            integer     152
    SQL>Message was edited by:
    user52

  • How to print date/time in report page footer?

    Hi
    I have a report which users can print as PDF.
    However, I like to display current date/time in report footer.
    I can see the Page Footer in section but can't figure out how to print date/time there.
    Thanks for help.

    hi movilogo
    Please try this.
    Create hidden item P1_DATE
    Create On load process in page 1 and put this code
    begin
    :P1_DATE:=TO_CHAR(SYSDATE,'DD-MON-YYYY HH:MM:SS');
    end;
    Open your region in Page 1 put this code in Footer area
    *&P1_DATE.*
    Refresh your page.
    you will get the output like this.
    16-SEP-2009 11:09:17
    thanks
    Mark Wyatt

  • How to print Data Model in Report??

    Do anyone know how to print Data Model??
    Thanks your help.
    - Frank

    Hi Venkat,
    Thanks alot.... i am checking the appendix k.
    I want to know that if i want to customize the report as per the client requirement,
    can you please let me know which template i will use if i required remittence advice as well as check print data on the layout.
    The following is the list of field i required:
    Vendor ID
    Check Date
    Check number
    invoice date
    invoice/ CR memo number
    invoice description
    invoice gross amount
    invoice discount amount
    invoice net amount
    total gross amount
    total discount amount
    total net amount
    logo
    company name and info
    bank name and info
    check number
    check amount spelled out
    check date
    check amount numeric
    payee name
    CEO signature
    MICR check number
    MICR routing number
    MICR bank account number
    mailing return address
    mailing address
    Venkat it would be great help if you please let me know the exact process to be follow for check printing report.
    I worked on bi publisher report in 11i, but in 12i the process is bit different.
    also if you have any template ready can you please send me on my mail id ... i forwarded you the test mail from my official id or on [email protected]
    Looking forward to your kind response.
    Regards
    Ratnesh

  • How to print date & time in photos

    Thanks for the help.
    I need to print either photos with time and dates in them... or the Bridge contact sheet with date and time info.
    The final printed image will be used in court to photo document evidence.
    Do I have to do a screen capture or is there some other way?
    My camera will not allow me to imprint time and date.
    I'm using CS4 on both Windows and Mac.
    Thanks again in advance for the taking the time to help.
    Dances With Pixels
    I may have sent this twice, but I'm new to this and this is my first time trying to post.

    Thank you for taking the time to respond.  Much appreciated. 
    And will follow up on your suggestions.
    Date: Tue, 10 Aug 2010 23:55:31 -0600
    From: [email protected]
    To: [email protected]
    Subject: How to print date &amp; time in photos
    I think there are (various) Scripts about for that.
    For example addExifDate1.5.jsx:
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1346521
    One should be able to adapt it to include the time.
    You could ask in the Photoshop Scripting Forum or http://www.ps-scripts.com/
    >

  • How to print date & time stamp on photos?

    How to print date & time stamp on photos?

    Three methods:
    File>process multiple files>labels. Be sure to uncheck "same as source", or the originals will be overwritten. It is best to work on duplicate files, esp. while learning.
    Use the horizontal or vertical type tool to add the information manually to each picture file
    If the same information is to be applied to several pictures, e.g. a copyright notice, use  of a brush made in PSE is very efficient

  • How to print date in cheque box in sapscript??

    Hello Guru,
    We have developed or design new form for cheque printing in sapscript
    how to print date in cheque box in sap.
    1
    6
    1
    2
    2
    0
    1
    1
    thanks in advance.
    Thanks & Regards
    Richa

    hi,
    If your requirement is to display date with box,first create a Box by using following syntax
    *   &sy-datum&
    /:  BOX XPOS '0' CH YPOS '3.65' LN WIDTH '77.50' CH HEIGHT '4.5' LN FRAME '10' tw
    then adjust the box size according to your requirement by changing xpos,ypos,width and height
    with regards
    Edited by: naresh bammidi on Dec 16, 2011 8:00 AM

  • How to print data in CCMMDDYY

    how to print data in the following format
    "CCMMDDYY"

    hi
    good
    yes you can very much print in that format, just follow this process
    1-declare 4 strings
    2-store all the different type of data in different variables
    3-concatenate them and store them in a different variable
    4-display tht varibale which contain that concatenate value
    thanks
    mrutyun^

  • How to convert system Date into DD-MMM-YYYY Format

    hi friends,
    please help me How to convert system Date into DD-MMM-YYYY Format.
    Regards
    Yogesh

    HI..
    data: w_dt(11) type c,
             w_month(2),
             w_mon(3).
    w_month = p_date+4(2). **p_date = given date**
    case w_month.
    when '01'.
    w_mon = 'Jan'.
    when '02'.
    w_mon = 'Feb'.
    when '03'.
    w_mon = 'Mar'.
    when '04'.
    w_mon = 'Apr'.
    when '05'.
    w_mon = 'May'.
    when '06'.
    w_mon = 'Jun'.
    when '07'.
    w_mon = 'Jul'.
    when '08'.
    w_mon = 'Aug'.
    when '09'.
    w_mon = 'Sep'.
    when '10'.
    w_mon = 'Oct'.
    when '11'.
    w_mon = 'Nov'.
    when '12'.
    w_mon = 'Dec'.
    endcase.
    Now...
      concatenate p_date6(2)  '-'  w_mon  '-'   p_date0(4)  into w_dt.
    write w_dt.

  • Valiadtion of date in dd.mm.yyyy format

    i have a selection screen in which i want user to enter date in dd.mm.yyyy format only.how can i validate that.any FM.
    i also want that date to be changed in yyyymmdd format coz i have to update that in a field which has yyyymmdd format.
    so is there any fm for this also ( to change dd.mm.yyyy to yyyymmdd).
    any pointers will help.

    Hi Govind,
    Based on the user defaults in the transaction SU01 the date will be verified based on the date format selected in the user details.
    Declare the selection screen variable as of type Sy-DATUM.
    what ever format you had entered the date in the selection screen the variable will hold the value in the format yyyymmdd.
    no need to do any format for the date.
    hope this might help you.
    regards,
    Phani.

  • Displaying date in dd/MM/yyyy format

    Hi all,
    I am having one date field .To display the date in correct format, I created a dictionary simple type of type date and entered dd/MM/yyyy in representation tab.
    I was using 2004 and it was working properly. Now I am using 2004s for the same application. The problem is when I am selecting a date , it is showing the date in MM/dd/yyyy format in first time. If I selects the date again, then it will be in dd/MM/yyyy format. How can I make the selection in dd/MM/yyyy in first time itself
    Thanks 
    Fahad Hamsa

    Hi,
       Try this:
    1. Create a simple type in the local dictionary. Call it say, CustomDateType.
    2. Set the built-in type as date.
    3. Go to the representation tab and under "External Representation" set the format to "dd/MM/yyyy".
    4. Create a context value attribute day, CustomDate and set its type to CustomDateType.
    5. Create an inputfield with id say, "DateField" and bind its value property to CustomDate.
    6. Now in your wdDoModifyView() write the following code:
    if(firstTime){
       IWDViewElement e = view.getElement("DateField");
       e.requestFocus();
    Regards,
    Satyajit.

  • Converting string to date in mm/dd/yyyy format

    Hi,
    I used simpledateformat to convert date to "MM/dd/yyyy" format.
    Now when i want to insert into db, i want the value as date object instead of string [returned by format method of SimpleDateFormat]
    what should i do?
    Date dt = new Date();
    SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
    System.out.println("Formatted date is coming as "+sdf.format(dt));
    Date dt1 = sdf.parse(sdf.format(dt);
    System.out.println("parsed date is coming as " +dt1);
    output :
    1 SOP returns 11/07/2007 [current date]
    2 SOP returns Wed Nov 07 00:00:00 GMT+05:30 2007

    If you are using PreparedStatements setDate method, you need a java.sql.Date object, not a Java.util.Date object. You can create an sql.Date object from a util.Date object as follows:
    java.sql.Date sqlDate = new java.sql.Date(dt.getTime());And, if you are not using PreparedStatement and its setDate method, then change now.
    Doing
    Date dt1 = sdf.parse(sdf.format(dt));is meaningless. You format the date to string, then parse the string back to a date? Why? Why not just use the original Date object? And you won't get a sql.Date object that way, either, as the DateFormat classes return a util.Date object.
    Edit: And for more info:
    A Date does not have a format. It is simply a number. The "format" only comes into play when printing the String representation of the Date, and that is not handled by the Date object itself (except when calling toString either explicitly or implicitly).

Maybe you are looking for

  • Getting error message in debug "Page contains page items/buttons which are not assigned to a region!"

    Hi, I created a form and when I submit, it goes through but there is no "success" or "failure" message on Apex. I tried debugging it and got this message: "Page contains page items/buttons which are not assigned to a region!" I looked at the page def

  • Large File Processing Problem

    HI Group, I am facing problem in XI while processing 48 MB File through File adapter,I have used Content Conversion in the design. I am using normal 64Bit operating system with Max of 2GB heap size,still I am facing the problem,Can any body tell me h

  • How to know the Column name which contains some value?

    Suppose if a table contains 30 columns, and I want to know the name of the Column that contains my search text(Value). For Eg. I have a Table named Allowances contains 20 columns for referencing 20 types of allowances. The columns are named like Allw

  • Can't download game

    On a 4th gen iPod touch running iOS 5.1.1, I have purchased a game - Altair's Creed.  But, it won't complete the download to the iPod.  It shows a status bar until about half-way done, then alternates between "waiting" and "loading", then comes up wi

  • IOS 5 not working with BOSE soundock

    After upgrading my ipod touch to IOS 5 my Bose soundock can not recognize it anymore. Has anyone solved this problem? Has anyone talked to Apple support about this problem?