Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

timestamp format

Hi guys,

How can I get a date in format YYYY-MM-DD h:mm:ss TT?

=If(Auto_Id=1519,Timestamp((num(date#(TimeStamp, 'YYYY-MM-DD h:mm:ss[.fff] TT'))-0.0417)), 'YYYY-MM-DD h:mm:ss[.fff] TT')

I got in result 9/13/2015 2:40:49 AM

Thanks,

Labels (1)
5 Replies
MK_QSL
MVP
MVP

What is the format of your TimeStamp field?

Anonymous
Not applicable
Author

'2015-09-13 3:42:09 AM'

Anonymous
Not applicable
Author

I got it

Timestamp((num(date#(TimeStamp, 'YYYY-MM-DD h:mm:ss[.fff] TT'))-0.0417),'YYYY-MM-DD hh:mm:ss TT' )

just remove .[fff]

MK_QSL
MVP
MVP

=TimeStamp(TimeStamp# ('2015-09-13 3:42:09 AM','YYYY-MM-DD h:mm:ss TT')-0.0417,'YYYY-MM-DD h:mm:ss TT')

maxgro
MVP
MVP

replace '9/13/2015 2:40:49 AM' with your field

=Timestamp(Timestamp#('9/13/2015 2:40:49 AM', 'MM/DD/YYYY hh:mm:ss TT'), 'YYYY-MM-DD h:mm:ss TT')

1.png

the bold part is from text to num (interpretation function, Timestamp#)

the non bold part is from num to text (formatting function (Timestamp)

more here

Qlik Design Blog : Get the Dates Right | Qlik Community