Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have the date fields 'Created' and 'Resolved 'in the format '01/Apr/12 9:18 AM' . I need to change it to normal format like 'YYYY-MM-DD' or 'YYYY-MM-DD hh:mm:ss' with timestamp for calculating the Date difference. How can i convert it?
Thanks in Advance...
Br,
Prasanna
Hi Prasanna,
Use timestamp Function as mentioned below,
timestamp( FieldName,'YYYY-MM-DD hh.mm')
Use this at Load time.
Regards,
Nilesh Gangurde
Hi Prasanna,
Use the interpretation functions such as Timestamp#() or Date#() (note the pound sign before the opening parenthesis). Take a look at the following example:
=Date(Date#('01/Apr/12 9:18 AM', 'DD/MMM/YY h:mm TT'))
In a text object, this will return "01/04/2012" or the field according to your script variable DateFormat.
=Timestamp(Timestamp#('01/Apr/12 9:18 AM', 'DD/MMM/YY h:mm TT'))
In a text object, this will return "01/04/2012 09:18:00" or the field formatted according to your script variable TimestampFormat.
Note how I'm using both functions with and without the pound sign. Check the Reference Manual for further reference on date and number formats.
Hope that helps.
Miguel