Convert mm/dd/yyyy to this format dd/mm/yyyy

Hi Gurus,
How can I convert given this date format 10/19/2011 13:32:34 from my xml to this output dd/mm/yyyy hh:mm:ss?
Need your help.
Thank you
Jayp
Edited by: BIPnewbie on Jan 19, 2012 12:45 AM

Thanks kavipriya for your response on this.
Actually I was looking for similar kind of date conversion ....my xml date format is yy/mm/dd and need to convert to mm/dd/yyyy format...i tried regular format-date function but it didnt work.
Now your function working fine ...
Thanks a lot
skat

Similar Messages

  • Date should be in this format DD-MON-YYYY  HH:MI:SS

    Hi All,
    I am having a column date data type ,in that i am using SYSDATE and formating as DD-MON-YYYY HH:MI:SS but result iam not getting in this format,any one please help me regarding this..
    Thanks in Advance..
    Edited by: 30021986 on Oct 14, 2012 1:38 PM
    Edited by: 30021986 on Oct 14, 2012 3:38 PM

    there is a misunderstanding.
    Your database column is in a DATE type. This is a type, and thanks to this type, you can DISPLAY the date in various ways in a query editor (toad, sql developer...).
    I mean, there is no various physical Date type columns, but only one called "date".
    If you want to display this date in the way "DD-MON-YYYY HH:MI:SS", then convert it into "CHAR" (or VARCHAR) type with the function TO_CHAR (in oracle).
    Example : to_char(sysdate, 'DD-MMMM-YYYY HH24:MI:SS").
    But the result will be an alphanumeric type. You won't be able to do further operation on date, like adding a day for instance.
    That's why you should keep the date format in the column of your database table, but convert it in your queries.
    If you really need to have this specified format, then use the char or varchar type in your database table.

  • How to convert dd-MM-yyyy into yyyy-MM-dd format in mysql

    i have designed a database in mysql and i have connected it using jdbc connectivity . so i want to convert an input date with this format dd-MM-yyyy into yyyy-MM-dd a legal format of mysql

    Friends , I found another way to get a mysql format
    String dateString = "23/08/2003"; (this string can be input date)
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
         java.util.Date d;
         try
              d = dateFormat.parse(dateString);
              dateFormat.applyPattern("yyyy-MM-dd");
              dateString = dateFormat.format(d);
         catch (Exception e){
                   e.printStackTrace();
              java.sql.Date a3 = java.sql.Date.valueOf(dateString);
    where a3 is the date with the mysql format needed and can be inserted into sql statement.

  • Convert the date of string to datetime format 'MM/dd/yyyy' when the system date format is 'dd/MM/yyyy'.

    I need convert the date of string format 'MM/dd/yyyy' to datetime format 'MM/dd/yyyy' when the system date format is 'dd/MM/yyyy'.Since
    I need to search values based on date where my database datetime  is 'MM/dd/yyyy' format.

    In my opinion you should re-consider the assumption that the date picker returns a string. Maybe it is able to return a
    DateTime object directly instead of string. Then you will pass this value as a parameter of SQL query. This should work regardless of computer configuration.
    Otherwise, follow the previous string-based approaches.

  • How to convert (YYYY-MM-DD) to (DD-MM-YYYY)

    Hi Guys,
    I have one doubt on WDJ,
    While exporting data into Excel Sheet having date format is showing like the format (YYYY-MM-DD).
    But I need to convert into this format (DD-MM-YYYY). Can any one suggest me? How to convert (YYYY-MM-DD) to (DD-MM-YYYY)
    I was written this code for getting date from ECC System and Convert to String type.
    Date DelivDate = wdContext.nodePoDetails_ExcelData().getPoDetails_ExcelDataElementAt(i).getDeliv_Date();          
    String DelivDate1 = DelivDate.toString();     
    Date ShtDate = wdContext.nodePoDetails_ExcelData().getPoDetails_ExcelDataElementAt(i).getStat_Date();
    String ShtDate1 = ShtDate.toString();     
                //wdComponentAPI.getMessageManager().reportSuccess("ShtDate1::"+ShtDate1);
    Date ExptShpDate = wdContext.nodePoDetails_ExcelData().getPoDetails_ExcelDataElementAt(i).getExpt_Shp_Date();     
    String ExptShpDate1 = ExptShpDate.toString();
    Regards
    Vijay Kalluri

    Hi Greg,
    Still i haven't resolve the issue.
    SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
    sdf.format(date);
    Date DelivDate = wdContext.nodePoDetails_ExcelData().getPoDetails_ExcelDataElementAt(i).getDeliv_Date();
    String DelivDate1 = DelivDate.toString();
    could you please give me more clarification on above code. if possible.
    Regards
    Vijay Kalluri

  • Need to convert  Date from calendar to String in the format dd-mom-yyyy

    Need to convert Date from calendar to String in the format dd-mom-yyyy+..
    This is absolutely necessary... any help plz..
    Rgds
    Arwinder

    Look up the SimpleDateFormat class: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
    Arwinder wrote:
    This is absolutely necessary... any help plz..For you maybe, not others. Please refrain from trying to urge others to answer your queries. They'll do it at their own pace ( if at all ).
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • How to convert the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:M'

    How can i convert a the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:MI:SS AM' in Oracle
    I have a query
    select UPPER(t.val_10) "TYPE", count(val_3) "Number of Transfers"
    from table1 t
    where t.is_active = 1
    and t.val_4 = 'INBOUND'
    and to_date(to_date(val_5,'MM/DD/YYYY HH:MI:SS AM'), 'DD/MM/YY') between to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY') and add_months(to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY'),1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)
    I get the error [ORA-01861: literal does not match format string which i think is because
    val_5 has the values in the following format:
    8/29/2008 6:31:10 PM
    Does anyone have an answer?
    Thanks in advance
    Edited by: user2360027 on 26-Mar-2009 03:50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    first off, you've got to_date(to_date(...)) - NEVER do this - you're forcing an implicit to_char which can cause all sorts of problems!
    What is the data type of your column val_5? If it's DATE then your query is simply:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    val_5 between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)If it's a varchar2 (why, oh why, oh why, ...?!), then your query should be:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    to_date(val_5, 'mm/dd/yyyy hh:mi:ss AM') between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)Remember that dates in DATE format are stored in an internal Oracle format - in order for you to tell Oracle that your string is a date, you need to use to_date. When you want to retrieve a date, you need to use to_char to put it into the format you want to see it in.
    Remember also that your nls_date_format defines the default format that you'll see a date, which is what is used in the implicit conversion that oracle does when you select a date:
    SQL> alter session set nls_date_format='dd/mm/yyyy hh24:mi:ss';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    26/03/2009 11:01:53
    1 row selected.
    SQL> alter session set nls_date_format='mm/dd/yy hh12:mi:ss AM';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    03/26/09 11:02:24 AM
    1 row selected.It doesn't make sense to convert something that's already in a DATE format into a DATE format - in order to do that, oracle has to first change the date into a string, and it does that by using the nls_date_format parameter setting - if you're working with dates-in-strings that are in a different format, then all sorts of problems arise, as you have found out!

  • To convert date dd/mm/yyyy in Timestamp format

    hi
    I want to convert date of format dd/MM/yyyy, which get from user by PropertyUtils.getSimplePropetrty(form, "startDate"); , into Timestamp format...........
    please help me in this regard.......
    1904

    ya mean it from java.sql.Timestamp
    and also I am using getTime() method but giving
    root cause:
    org.apache.commons.beanutils.ConversionException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
    and
    Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
    at java.sql.Timestamp.valueOf(Timestamp.java:160)
    at org.apache.commons.beanutils.converters.SqlTimestampConverter.convert(SqlTimestampConverter.java:157)

  • Converting Date Column to format MM/DD/YYYY in RPD

    Hi all,
    I have a requirement like converting a Date column to format MM/DD/YYYY in RPD. Any help as we are not supposed to use the BI Answers Data Fomat for showing this format.
    Thankyou,
    Edited by: [email protected] on May 10, 2010 11:49 PM

    Hi Saichand,
    I need the resulting column in DATE format only. The solution which you specified converts the datatype to character. Is there anyway to convert the format but not the datatype.

  • Convert a String Mar 7, 2008 to date in yyyy-dd-mm format

    Hi,
    Please help me to Convert a String Mar 7, 2008 to date in yyyy-dd-mm format..
    have to store that Date in SQL Server date field in yyyy-dd-mm.
    Regards,

    I done this and got the desired result 2008-03-07. Thanks... know checking it with my code :)
    String ss = "Mar 7, 2008";
              //System.out.println(ss);
              try{
              SimpleDateFormat dateFormat = new SimpleDateFormat("MMM dd, yyyy");
              Date date = dateFormat.parse(ss);
              System.out.println(date.toString());
              System.out.println(new java.sql.Date(date.getTime()));
              }catch(Exception ee)
                   ee.printStackTrace();
              } //endsEdited by: bunty_india on May 8, 2008 8:09 PM

  • To convert dec date 732,677 in to dd.mm.yyyy format

    Hi,
    i have to convert dec date 732,677 in to dd.mm.yyyy format .
    plz help me out
    its urgent
    regards,
    Nishu Gupta

    use this Fm
    CONVERSION_EXIT_INVDT_INPUT
    <b>CONVERSION_EXIT_INVDT_output.</b>
    i hope u r referring to Tcurr-gdatu.
    refer this code for the working ..
    data : date like sy-datum,
           date1(10) type c,
           val like sy-datum,
           datum(8) type n .
    date = sy-datum.
    write:/ date.
    concatenate date4(2) date6(2) date+0(4) into val.
    CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
      EXPORTING
      input          = val
    IMPORTING
       OUTPUT        = datum.
    write:/'tcurrformat' datum.
    *clear val.
    CALL FUNCTION 'CONVERSION_EXIT_INVDT_OUTPUT'
      EXPORTING
        input         = datum   "----
    >pass this
    IMPORTING
        OUTPUT        = date1.
    write:/'normal format',  date1.
    Please close your previous threads.
    regards,
    vijay

  • Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format

    Can any one tell me Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format?

    have a look at the WIKI FAQs...they are very useful
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapDevelopmentand+Programming&
    For this it says:
    <i>How to convert a date to internal or external format?
    Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL
    to convert the date. When converting to external format, the date format from the user's user profile will be used. When converting to internal format, the result will be in YYYYMMDD format.</i>

  • OWB 10gR1 Convert Date format (mm-dd-yyyy) to (yyyy-mm-dd)

    Hi All,
    In OWB 10gR1, I have flatfiles with Date fields having the format (mm-dd-yyyy). I want to load this data into the Staging table in (yyyy-mm-dd) format. How could I do this conversion in my staging mapping ?
    Using external tables is not an option.
    An detailed answer will be extremely helpful.
    Thanks community.

    Wich is this field's datatype in database? Is it date or char? If you are going to store it as a date datatype, you don't have to worry about the date format.
    Have you tried using the Expression Operator to perform the date string conversion in your mapping? Sorry about this lame drawing, but I think it will help you understand:
    source_table ------------ALL_COLUMNS_EXCEPT_DATE_DATATYPE-------TARGET_TABLE
                 |                                                 |
                 +-------EXPR{TO_DATE(DATE_FIELD, 'DATE_FORMAT')}--+In this example, you'll use an expression operator to convert the date string in the format you want. Map other attributes directly to your target table (or other transformations you need to perform).
    This is the generated script of a dummy plan I've built here:
    OPTIONS ( ERRORS=50, BINDSIZE=50000, ROWS=200, READSIZE=65536)
    LOAD DATA
      CHARACTERSET WE8MSWIN1252
      INFILE '{{LOC_FILE.RootPath}}load.csv'
    INTO TABLE "LOAD_TARGET"
      APPEND
      REENABLE DISABLED_CONSTRAINTS
      FIELDS
        TERMINATED BY ';'
        OPTIONALLY ENCLOSED BY '"'
      "COD" POSITION (1) INTEGER EXTERNAL ,
    "NOME" CHAR ,
    "DATA" CHAR "to_date( :\"DATA\" , 'yyyy-mm-dd')"
      )Regards,
    Marcos

  • How to convert a date field with format (dd,mm,yyyy) to format (mm,dd,yyyy)

    Hello.
    How to convert a date field with format (dd,mm,yyyy) to format (mm,dd,yyyy)
    I have text field which has a databind to a date field. When I click on it, we can select the date, it is added on the format (dd,mm,yyyy). When I want to insert this date field to a database It doesnu2019t allow me to do it because it will only accept date field on the format (mm,dd,yyyy)
    I tried to store this format on a date variable and I get a message saying that is impossible to convert a string into a date.
    Regards,
    Jose

    Hi Jose,
    usually you format strings in c# like
    string.Format("{0:yyyyMMdd}", insertyourstring);
    in your case
    string.Format("{0:MM/dd/yyyy}", insertyourstring);
    [look here|http://idunno.org/archive/2004/14/01/122.aspx]
    there are more details
    if everything fails split the string with Mid()
    or ask me
    lg David

  • How to convert sysdate to the format dd-mon-yyyy

    how to convert sysdate to the format dd-mon-yyyy

    <how to convert sysdate to the format dd-mon-yyyy>
    This question is better answered by thinking about about how Oracle dates work. SYSDATE is a pseudocolumn (function without any arguments) that returns a date value: it already is a date. Oracle date values are stored not as we see them, say 'DD-MON-YY', but as a series of bytes with the different date components from the millennium down to the second. We NEVER see dates as they are stored but use the formats for automatic conversion.
    To display a date the way you want use TO_CHAR() with an edit mask or as others suggested change your NLS_DATE_FORMAT (thought I advise against this as most systems use DD-MON-YY and porting queries from other systems or even OTN can easily break). To change a converted string back to a date use TO_DATE() with an edit mask.

Maybe you are looking for