Date Format Function Needed

Hi All ,
I need date format in the following format 2009-01-28T09:09:38.0Z...
please let me know how can i get this

The Z in a time string typically refers to Zulu time or Greanwich Mean Time, so if you need the zulu time you need to convert your date to a timestamp containing time zone information and shift it to GMT time then format the output as required like so:
with sample_data as (select to_date('2009-01-28 9:09:38','RRRR-MM-DD HH24:MI:SS') dt from dual)
select to_char( cast( dt as timestamp with time zone) -- Cast the date to a timestamp containing time zone
                      at TIME zone 'GMT'              -- shift the timestamp to the UTC time zone
              , 'YYYY-MM-DD"T"HH24:MI:SS.FF1')||'Z'   -- Format the timestamp as a character string
  from sample_data;

Similar Messages

  • Date format function for 5/2/2010 9:46:00 AM?

    Hi,
    I want to convert date format in dd/mm/yyyy hh:mm:ss AM/PM format.
    Any suggestion?
    Thanks.

    You can use:
    <?format-date:xdoxslt:sysdate_as_xsdformat();'SHORT_TIME';’GMT-5’?>
    Your date must be in ISO format, please read below
    Reference:
    http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/e12187/T421739T481157.htm#4535403
    regards
    Jorge

  • Date Format help needed

    Hello Friends,
    I need to mormat my date valye to get something like the following:
    Sunday December 3rd, 2006 OR
    Tuesday December 5th, 2006
    I understand that one can give a custom format for date as per the SimpleDateFormat symbols. However, I did not find anything for achieveing the pattern in bold
    Can you please help?
    Regards,
    Leena

    umm.. did not think about it..
    I thought on it after reading your post.
    My first thoughts for writing my own formatter are that I will have to extend the SimpleDateFormat class, right?
    Not sure what do I do next.. :(
    Regards,
    Leena

  • Date format function in xquery - osb

    Hi
    I want to assign current datetime to </DateTime> node in the following format in an xquery mapping file
    <DateTime>2013-09-10T06:49:12Z</DateTime>
    I have tried to do it as follows but it gives error
       <DateTime>{fn:format-dateTime(fn:current-dateTime(),"[Y01]-[M01]-[D01] T[H01]:[m01]:[s01]:[f01]Z")}</DateTime>
       <Destination>ERP</Destination>
       <Sender>CRM</Sender>
    Thanks in advance... can someone help me on this

    You can try this. This will give you the desired format.
    fn:concat(fn-bea:date-to-string-with-format("yyyy-MM-dd",fn:current-date()),"T",fn-bea:time-to-string-with-format("HH:mm:ss", fn:current-time()),"Z")
    Thanks
    Jahangir

  • Data format - Help needed!!!!!

    I have a String with this value:"Thu Dec 19 09:23:49 2002" ;
    is there a java method to convert it automatically in another string to this format: "19/12/2002" or "12/19/2002" (it depends on italian date)
    thanks all!!

    As dateString does not seem to be a proper Java term (unless Mr sssako knows something I do not) I would be a string.
    You could do it with two instances of SimpleDateFormat, one set up for the format of the string you have and one set up for the format you want.
    You then call parse() on the first one to get a date and use that date as the parameter to a call to format on the second one.
    String s = "Thu Dec 19 09:23:49 2002";
    SimpleDateFormat input = new SimpleDateFormat("E MMMM d HH:mm:ss yyyy");
    SimpleDateFormat output = new SimpleDateFormat("dd/MM/yyyy");
    try
        s = output.format( input.parse(s) );
        System.out.println(s);
    catch ( ParseException e )
        e.printStackTrace();
    }

  • Converting date format function

    Hi All
    I want to convet standard date 20061215 (yyyymmdd) into 15/12/2006 format, can any body help me with this.
    kind regards
    Anup

    Hi anupam,
    1. we can use simple WRITE to variable
       concept.
    2. just copy paste.
    report abc.
    data : d1 type sy-datum value '20061215'.
    data : s(10) type c.
    write d1 to s.
    replace all occurrences of '.' in s with '/'.
    write :/ s.
    regards,
    amit m.

  • Convert the date into user default date formate

    I am wrinting a bdc and i want to convert the date into user default date farmate ..please suggust the functiom module should i use...

    actually by using dats or d type you can get the user specific date itself.
    but if u have different dates format that need to be converted to the user specific date then you can follow below procedure
    1. retrieve the user format from usr01
        SELECT SINGLE datfm
          INTO w_datfm
          FROM usr01
         WHERE bname EQ sy-uname.
    pass w_datfm to the below FM (4th import parameter)
    2. create Z - FM and retrieve the user secific date
    FUNCTION ZFXX_USER_SPECIFIC_DATE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(IW_DAY) TYPE  CHAR2
    *"     VALUE(IW_MONTH) TYPE  CHAR2
    *"     VALUE(IW_YEAR) TYPE  CHAR4
    *"     VALUE(IW_DATFM) TYPE  USR01-DATFM
    *"  EXPORTING
    *"     VALUE(EW_USER_DATE) TYPE  CHAR0008
    *1  DD.MM.YYYY
    *2  MM/DD/YYYY
    *3  MM-DD-YYYY
    *4  YYYY.MM.DD
    *5  YYYY/MM/DD
    *6  YYYY-MM-DD
    CASE iw_datfm.
      when '1'.
        concatenate iw_day iw_month iw_year
               into ew_user_date.
      when '2'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '3'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '4'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '5'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '6'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when others.
        clear ew_user_date.
    endcase.
    ENDFUNCTION.

  • Date format in a JTextField

    I have created 2 jtextfields to enter a start and stop date for printing a report within the date range selected. How do format the jtextfields to insure they are properly date formatted i.e. MM/dd/yyyy
    Thanks, William

    If you create an input binding of Formatted Text Field, you can specify the format mask by right-clicking the binding and clicking "Edit" from the structure pane. Then select "Format" and set whatever date format you need. This is true in 10.1.2, so it might not be available depending on what version you are using.

  • Date Format IN BDC

    Hi,
    In One Interview I was asked that How can You Handle Data Format when Writing BDC ?

    Satya,
    The date format depends on User settings. Its different for different login ID's.
    It can be YYYY.MM.DD or MM.DD.YYYY or anything.
    To handle the date format, you need to query on table USR01 and fetch DATFM field that stores date format.
    Refer below piece of code
    */...Fetch the date format settings for the user
          SELECT SINGLE datfm
                   INTO gv_date_format
                   FROM usr01
                  WHERE bname = sy-uname.
      CASE gv_date_format.
        WHEN 1.     "DD.MM.YYYY
          CONCATENATE fv_impdate+6(2) '.'
                      fv_impdate+4(2) '.'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 2.     "MM/DD/YYYY
          CONCATENATE fv_impdate+4(2) '/'
                      fv_impdate+6(2) '/'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 3.     "MM-DD-YYYY
          CONCATENATE fv_impdate+4(2) '-'
                      fv_impdate+6(2) '-'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 4.     "YYYY.MM.DD
          CONCATENATE fv_impdate+0(4) '.'
                      fv_impdate+4(2) '.'
                      fv_impdate+6(2) INTO fv_expdate.
        WHEN 5.     "YYYY/MM/DD
          CONCATENATE fv_impdate+0(4) '/'
                      fv_impdate+4(2) '/'
                      fv_impdate+6(2) INTO fv_expdate.
        WHEN 6.     "YYYY-MM-DD
          CONCATENATE fv_impdate+0(4) '-'
                      fv_impdate+4(2) '-'
                      fv_impdate+6(2) INTO fv_expdate.
      ENDCASE.
    This would convert the date into the format set for user.
    Hope this is helpful.
    Amogh

  • Custom DBProvider - Date Format Problem

    Hi All,
    I have created a custom DBProvider that inserted form value into database .
    I want date format in "yyyy-MM-dd HH:mm:ss" ..
    When I pass date in this format ....
    It throws error :
    05.31 11:49:43.943     IdcServerThread-3     Exception !csDateParseError,2010-05-25!syUnableToParseDate,2010-05-25!syUnableToFindText,/
    intradoc.data.DataException: !csDateParseError,2010-05-25!syUnableToParseDate,2010-05-25!syUnableToFindText,/
         at intradoc.jdbc.JdbcQueryUtils.appendParam(JdbcQueryUtils.java:305)
         at intradoc.jdbc.JdbcQueryUtils.buildQuery(JdbcQueryUtils.java:174)
         at intradoc.jdbc.JdbcWorkspace.buildQuery(JdbcWorkspace.java:745)
         at intradoc.jdbc.JdbcWorkspace.execute(JdbcWorkspace.java:639)
    Please help

    Hey,
    could share your code part inwhich you save the date, also the date format of your UCM.
    cheers,
    sapan
    Edited by: Swapnil Solanki on Jun 1, 2010 1:07 AM
    SYSTEMLOCALE
    Type and Usage
    ™ Configuration Variables (page -3)
    ™ Localization (page -25)
    Description
    Sets the system locale for the content server.
    ™ This setting controls the following:
    • localized strings used in the content server interface
    • character encoding for web pages
    • date/time format
    • time zone
    • parameters used for full-text indexing
    Any of these individual features can be controlled by separate configuration entries or
    by changing the settings for the SystemLocale.
    ™ This setting can be changed on the Server tab of the System Properties utility. The
    defaults for a specific locale can be changed on the Localization tab of the System
    Properties utility.
    ™ If SystemLocale is not specified as a configuration setting, the SystemDateFormat
    (page -779) will be deduced directly from the OS settings in the Java VM instead of
    using the content server configuration table settings for the SystemLocale. If
    SystemLocale is explicitly defined, then the date/time format from the content server
    configuration tables for that locale will be used instead.
    ™ The configuration entries VerityLocale (page -889) and Ve r i tyEncoding (page -887)
    will still override settings from the SystemLocale, but configuring the SystemLocale
    directly is the preferred solution because there are many choices for Ve r i tyLocal e and
    VerityEncoding that are not compatible.
    SYSTEMDATEFORMAT
    Type and Usage
    ™ Configuration Variables (page -3)
    ™ Date and Time (page -16)
    ™ Localization (page -25)
    Description
    Sets the date/time format for the content server.
    Note that there are two types of date formats: one that stores seconds and one that
    truncates seconds and stores the date up to the minute. If seconds are used, dates can only
    be stored up to the year 2037.
    ™ If SystemLocale (page -781) is not specified as a configuration setting, the
    SystemDateFormat will be deduced directly from the OS settings in the Java VM
    instead of using the content server configuration table settings for the SystemLocale. If
    SystemLocale is explicitly defined, then the date/time format from the content server
    configuration tables for that locale will be used instead.
    ™ The syntax for this format is an extension of the date format functionality provided in
    the standard Java class libraries.
    Location
    <install_dir>/config/config.cfg
    Example
    Used as a configuration entry to set the standard US date time using the four digit year
    format:
    SystemDateFormat=M/d{yyyy} {h:mm[:ss] {aa}[zzz]}
    Note: See Using Content Server in International Environments for information on date
    and time formats.

  • Date Format Error in Jtable

    Can Somebody Guide me.I have a table in mysql database on windows 2000 which contains a short date field.Now my probem is that when I submit date values 10/01/2006 .It is entered in database as 29/12/1899 .I searched a number of websites also but nothing could help me.some examples will be helpful.
    Thanks
    sushil singh

    What's the value of inserQuery? If you print out its value and run it directly on the database does it do what you expect?
    It's often better to use a PreparedStatement to execute updates on the database:
    PreparedStatement stmt = conn.prepareStatement("INSERT INTO my_table VALUES (?)");
    stmt.setDate(1, myDate);
    stmt.executeUpdate();That way you don't have to worry about what date format you need to convert your dates into to put them into the database.
    Hope this helps.

  • In bdc if date format of records is different  do we need to hard code

    in bdc if date format of records is different  do we need to hard code or bdc will support automatically,please provide the answer.

    Make sure to format the date before passing to BDC.
    data: datum(10) type c.
    call function 'CONVERT_DATE_TO_EXTERNAL'
      EXPORTING
        DATE_INTERNAL                  = SY-DATUM
      IMPORTING
        DATE_EXTERNAL                  = datum.
    Regards,
    Rich Heilman

  • Need help in converting date format

    Hi,
    Need help in converting date format from 'DD-MON-YYYY' to 'YYYY-MM-DD' in an .rtf template as I believe xml publisher supports the date format as 'YYYY-MM-DD' only.
    Thanks,
    Raj.

    I got the same problem, anyone know how to solve this problem? I allready found some date functions on http://blogs.oracle.com/xmlpublisher/2008/09/date_functions.html . I also tried <?xdoxslt:month_name(xdoxslt:get_month(xdofx:substr(NEED_BY_DATE, 4,3)), $_XDOLOCALE), 0, 'nl-NL')?>, but then it returns a namespace error (Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.). Anyone know how to fix this?
    Edited by: user11165753 on 7-dec-2009 23:50

  • Function module to convert date format

    hi all,
            i need a function module which will take the input as 09.02.2006(mmddyyy) and the out put should be sep-06. etc.
    Thanks & Regards
    suresh

    Hi Suresh,
    Use the function module 'MONTH_NAMES_GET' to get the month name and then use CONCATENATE to get SEP-06.
    You can also check another post which is currently running 'Regarding Date Format'.
    Thanks
    Vinod

  • Function Module to Convert date formate

    Hi All,
    I need to convert the date formate from ex :01-Jan-2009 into 01-01-2009.
    Is there any Function Module for this?
    Thanks
    Partha.
    Moderator message - Babu Kilari is correct - post locked
    Edited by: Rob Burbank on Apr 27, 2009 9:36 AM

    Hello Partha,
    I wanted to ask you a question. Why did you not search SDN Forums before posting.
    I think the time take for posting is higher than the time taken for searching.
    Am I right??
    Please let me know. I think the question you have posted is very basic
    Thanks,
    Babu Kilari

Maybe you are looking for