Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Format Issue

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

2 Replies
nilesh_gangurde
Partner - Specialist
Partner - Specialist

Hi Prasanna,

Use timestamp Function as mentioned below,

timestamp( FieldName,'YYYY-MM-DD hh.mm')

Use this at Load time.

Regards,

Nilesh Gangurde

Miguel_Angel_Baeyens

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