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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
userid128223
Creator
Creator

convert in date & time format

Hi Everyone

I have following call:

LET vDate= Peek('StartD',$(i),TableA)

vDate = 04/06/2017 13:27:15

How can i convert it into:

vDate=2017-04-06T13:27:150Z

1 Solution

Accepted Solutions
sunny_talwar

May be this

LET vDate = Date(Date#(Peek('StartD',$(i),TableA), 'MM/DD/YYYY h:mm:ss'), 'MM/DD/YYYYT h:mm:ss0Z');

or

LET vDate = Text(Date(Date#(Peek('StartD',$(i),TableA), 'MM/DD/YYYY h:mm:ss'), 'MM/DD/YYYYT h:mm:ss0Z'));

View solution in original post

5 Replies
Anil_Babu_Samineni

What is the 0Z ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

May be this

LET vDate = Date(Date#(Peek('StartD',$(i),TableA), 'MM/DD/YYYY h:mm:ss'), 'MM/DD/YYYYT h:mm:ss0Z');

or

LET vDate = Text(Date(Date#(Peek('StartD',$(i),TableA), 'MM/DD/YYYY h:mm:ss'), 'MM/DD/YYYYT h:mm:ss0Z'));

antoniotiman
Master III
Master III

Hi,

I assume Your Timestamp Format is

SET TimestampFormat='MM/DD/YYYY hh:mm:ss[.fff]';

=Replace(Timestamp(vDate,'YYYY-MM-DD_hh:mm:ss0Z'),'_','T') -> 2017-04-06T13:27:150Z

Regards,

Antonio

userid128223
Creator
Creator
Author

Hi Sunny

T in middle is not showing up & it is leaving spaces in between.

sunny_talwar

Don't need space

LET vDate = =Replace(Date(Date#(Peek('StartD',$(i),TableA), 'MM/DD/YYYY h:mm:ss'), 'MM/DD/YYYY@ h:mm:ss0Z'), '@', 'T');

Tried it with static date

=Replace(Date(Date#('04/06/2017 13:27:15', 'MM/DD/YYYY h:mm:ss'), 'MM/DD/YYYY@ h:mm:ss0Z'), '@', 'T')

Capture.PNG