How do I format a date string in ISO 8601 format?

Post Author: Perth
CA Forum: Formula
I am using a SaaS application, and uploading Crystal XI report templates to run using the application's reporting page. My custom date fields are stored using the ISO date format, and are made available as text strings in the form "yyyy-mm-ddThh:mm:ss" eg. "2007-10-09T00:00:00". The SaaS vendor say use a Crystal function. I have tried CDATE, DATEVALUE etc but these don't recognise the format as a valid date. I want to display this date as dd mmm yyyy.  Any ideas?

Post Author: Perth
CA Forum: Formula
I have found a solution from another forum and post it here to close this off.
It requires defining a "Report custom function". Use the formula workshop to create a function, giving it a name. Then paste this:
Function  (stringVar v1)Date (ToNumber (Left (v1,4 )),      ToNumber (Mid (v1, 6,2 )) ,      ToNumber (Mid (v1, 9,2 )) )
I can now format this date in the normal way as it is a date!

Similar Messages

  • Timestamp in ISO 8601 format

    Hi Experts
    Can anyone guide me to get the current timestamp in SAP to the below ISO 8601 format?
    2013-03-25T20:44:24.261Z

    Hi Peter,
    That's a regression. The ISO-8601 format should still be one of the supported formats. Can you please enter a bugzilla
    for this?
    Thanks,
    - thomas
    On 06/17/2010 03:27 PM, Peter Nehrer wrote:
    > Hi,
    >
    > prior to r11456, the buckminster.build.timestamp was supposed to be in
    > ISO-8601 format (as documented). However, now the format needs to be one
    > of the common formats:
    >
    > public static final String[] commonFormats = new String[] {
    > "yyyy-MM-dd_HH-mm-ss", "yyyyMMddHHmm", "yyyyMMdd-HHmm", "yyyyMMdd" };
    > //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    >
    > Is this intentional, or accidental and will it at some point be reverted
    > to ISO-8601 (or will ISO-8601 be added to those "common formats")? Note
    > the difference is in one line -- the new code calls timestamp =
    > DateAndTimeUtils.fromString((String) isoTS); while the old code called
    > timestamp = DateAndTimeUtils.fromISOFormat((String) isoTS);
    >
    > Thanks.
    >
    > --Peter

  • How to obtain a sql.Date in dd/mm/yyyy format

    hi everybody,
    I made a sql query in a jsp where a column of resultset is a Oracle Date, but I want to present it to the user in the format DD/MM/YYYY, how to do it ? with sql.getDate() ???
    thanks for your incoming help .

    Yuo can use the oracle function to convert the date format to a string for display purposes.
    Something like this I think
    SELECT TO_CHAR(thedatecolumn, 'DD/MM/YYYY')
    FROM thetablename;

  • How to convert server specific date string into client specific date object

    Hi developers,
    I have a very complex issue to convert the server date string format "EEE MMM dd HH:mm:ss z yyyy" into java.util.Date object and find the difference of the client machine date to represent the elapsed time
    The problem is the server time zone and client time zone are not unique and when I try to covert the server date which is in string format to date format using SimpleDateFormat class , I got the server time as 3:30 hours appended to it. The server time zone is in IST and Client time zone format is GMT+5:30 , the appended time of 3:30 hours created the confusion in calculating the elapsed time between the server started time and client requested time
    I went through all the sites but none of them were useful
    If any help to solve the above issue is appriciated
    please send the response with the same subject line
    Advance Thanks

    Why don't you just subtract from the server time the 3:30 hours (consult api of java.util.date) before comparing with the client date? Hard to see where's the problem...

  • Formatting a date in YYYY-MM-DD format in a grid in We dynpro abap

    Hi All,
    I have the requirement to display a date in YYYY-MM-DD format in a salv_wd_table grid .
    when i selecting the date from the calender that attached to a column in the grid will show in DD-MM-YYYY format.
    Please help in this.

    >
    Manoj Kumar wrote:
    > Hi Abhimanyu  ,
    >
    > I don't want like that.
    > Iwant to know is there any other way apart from this or any property to set the format of a column in salv grid.
    ABAP is pretty good about automatically using the user's profile settings for formatting. That enforces consistency across applications.  If you want to override this, you will need to do it at the data level.  Instead of defining this field in the context as a data - define it like a string or char10.  Then when you populate the data within your business logic do a WRITE statement from the data field to the character field.  During the WRITE command you can specify the date formatting option:
    From the online syntax of WRITE:
    Addition 15
    ... DD/MM/YY   | MM/DD/YY
      | DD/MM/YYYY | MM/DD/YYYY
      | DDMMYY     | MMDDYY
      | YYMMDD
    Effect: These additions influence the output of data objects of the data type d. In all other data types, the addition is ignored.
    The content of a data object of type d is interpreted as a valid date in the format YYYYMMDD and is output as follows for the individual additions:
    DD/MM/YY and MM/DD/YY:
    Both additions have the same effect. The date output has a two-digit year value and a separator. The separator and the order are taken from the definition for date output in the user master record.
    DD/MM/YYYY und MM/DD/YYYY:
    Both additions have the same effect. The date output has a four-digit year value and separator. The separator and the order are taken from the definition for date output in the user master record.
    DDMMYY und MMDDYY:
    Both additions have the same effect. The date output has a two-digit year value and no separator. The order is taken from the definition for date output in the user master record.
    YYMMDD:
    This addition provides a date output with a two-digit year value without a separator in the format YYMMDD.
    But even this approach is going to have limited impact. It will only let you chose between the allowed formatting types from the user master.  YYYY-MM-DD is not one of those formats.
    So if you really want a non-SAP formatted date you will have to break it up yourself.  The internal date format is always stored as YYYYMMDD. You can just parse it out:
    data year type char4.
    data month type char2.
    data day type char2.
    year = sy-datum+0(4).
    month = sy-datum+4(2).
    day = sy-datum+6(2).
    data date_string type char10.
    concatenate year `-` month `-` day into date_string.

  • How can I convert output data (string?) from GPIB-read to an 1D array?

    Hello all,
    I am reading a displayed waveform from my Tektronix Oscilloscope (TDS3032) via the GPIB Read VI. The format of the waveform data is: positive integer data-point representation with the most significant byte transferred first (2 bytes per data point).
    The output data of GPIB-Read looks like a string(?) where the integer numbers and a sign like the euro-currency sign are seperated by spaces e.g. #5200004C3 4 4 4 4 3C3C3........ (C represents the euro-currency sign).
    How can I convert this waveform data into a 1D/2D array of real double floatingpoint numbers (DBL) so I can handle the waveform data for data-analysis?
    It would be very nice if someone know the solution for this.
    t
    hanks

    Hi,
    First of all, I'm assuming you are using LabVIEW.
    The first you need to do is parse the string returned by the instrument. In this case you need to search for the known symbols in the string (like the euro sign) and chop the string to get the numeric strings. Here are some examples on parsing from www.ni.com:
    Keyword Search: parsing
    Once you parse the numeric strings you can use the "String/number conversion VIs" in the String pallette.
    Hope this helps.
    DiegoF.Message Edited by Molly K on 02-18-2005 11:01 PM

  • How do I take a date string, add "X" days to it, and display a new date?

    I have a date listed in a text string. I would like to convert it to a time stamp, and take a variable number of days, converted to seconds, added to the date, and displayed as a correct date. Example: 9/1/2011 adding 35 days is 10/6/2011. The trick seems to be getting it correct for every month and year combination. How can I accomplish this? I was thinking along the lines of time stamps, but any method that works consistently would be fine.
    Thank you!
    Solved!
    Go to Solution.

    You are right, use timestamps, they will take care of the working out the correct date for you.
    Interpret your string as a timestamp.
    Add your offset (use a numeric add, and consider using units on your variable)
    Reinterpret your datestamp as a string.
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • Formatting a date string

    I thought this would be easy enough, but I am having so much trouble doing this.
    I have a time stamp constant, which I have adjusted so that it is in the following format:
    %m/%d/%y
    Since I can't save files with " / " character, I am goint to use " . " instead.
    My original plan was using a 'search and split string' using '/' as a divider.
    This would give me 3 strings:
    %m
    /%d
    /%y
    That is perfect, except I dont want the '/' in front of the %d and %y.
    Could someone help me out with this last step?
    Cory K

    Or... You could just use the Format Date/Time String function:
    Message Edited by smercurio_fc on 08-08-2008 01:43 PM
    Attachments:
    Example_VI.png ‏4 KB

  • How to send the form data through mail with pdf format?

    forms 6i
    Hi to all,
    i am developed one master detail form.example is based on the dept number emp details will be displayed.here my requirment is whatever displayed on the form
    the data ,these data send to mail with any format.is it possible? if is possible any one give a proper solution.
    Regards,
    Stevie
    Edited by: 994418 on 6 May, 2013 11:15 PM

    Hello,
    you can create a Report that accepts the search parameters from the Forms mask and generates a PDF. You also have the option to send the report via mail.
    Personally I would generate the report with a tool like as_pdf
    http://technology.amis.nl/2012/04/11/generating-a-pdf-document-with-some-plsql-as_pdf_mini-as_pdf3/
    Then you can send the mail using utl_mail or utl_smtp.
    www.google.com/search?q=site:forums.oracle.com+utl_mail+utl_smtp
    Regards
    Marcus

  • Re-format a date-string?

    When I use this line with "Mail":
    set theReceivedTime to date received of theMessage as date
    I get this:
    onsdag 11 februari 2009 19.24.16
    I need this to be in standard datetime-format, like this:
    2009-02-11 19:24:16
    What is the easiest way to do this?
    Are there any built in functions to handle this, or do I (usch :)) need to create this by my self?

    Super!
    Just one thing
    This gives me this response:
    2009-02-12 19:0:0
    It should be ... 19:00:00.
    It's striking out one "0" in the minute and second...
    And I'm guessing that would happend 01:00:00 thru 09:00:00 as well.?
    I tried to understand your code, but came out blanc

  • How to download the report data in xml format

    Hi All,
    how to download the report data (sql/interactive) in xml format...
    Thanks,
    Vinoth

    You will want to do something like this:
    http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
    except customize it for xml.
    hth,
    John

  • 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).

  • Date string comparison

    I have a text file which has a date when a test was completed with the following format: 3/15/2004. If given a range of dates say 2/4/2004 - 5/6/2004, how do you compare the date string in the file to determine if it is in the date range given?
    Thanks

    Another option would be to convert the date to LV time format which you can compare immediately. Basically, you convert the different parts to numbers and then use a combination of string and time functions to convert. You can see an example for part of this here.
    Try to take over the world!
    Attachments:
    string.JPG ‏13 KB

  • How i can Catch perticular data from internet and update SAP R/3 data?

    Hi All,
    I want to catch data from internet and want to update those data into SAP R/3 database. So how i can catch those data ?. what will be format of data to update SAP R/3 database?

    Hi,
    You need to create your own BSP pages which would be displayed on internet/HTML.
    Transaction SE80 => Select BSP application.
    Best regards,
    Prashant

  • Convert java.sql.date to dd.mm.yyyy format

    Hi,
    Can any one tell me how to convert java.sql.date to dd.mm.yyyy format
    Regards,
    H.V.Swathi

    Hi ,
    Create a simple data type of type java.sql.date and give the format in it as "dd/MM/yyyy". This will work i guess.
    Regards
    Ishita

Maybe you are looking for