Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
kevinpintokpa
Creator II
Creator II

How to parse 20180619075546.0Z using TimeStamp# function

So I have a string (returned by an Active Directory utility) that looks like this: 20180619075546.0Z

I have tried all manner of format strings with the TimeStamp# function but it simply doesn't work.  None of these work, for instance:

Timestamp# ( modifyTimeStamp, 'YYYYMMDDhhmmss.0Z' ) returns 20180619075546.0Z

Timestamp# ( modifyTimeStamp, 'YYYYMMDDhhmmss' ) returns 20180619075546.0Z

Timestamp# ( Left ( modifyTimeStamp, 14  ), 'YYYYMMDDhhmmss' ) returns 20180619075546

Date# ( Left ( modifyTimeStamp, 8  ), 'YYYYMMDD' ) returns 20180619

What I am doing wrong?

Labels (1)
1 Solution

Accepted Solutions
kevinpintokpa
Creator II
Creator II
Author

I found that I had to:

a) Trim off any extraneous characters

b) Wrap the expression in another Timestamp function.

So this finally works:

Timestamp ( Timestamp# ( Left ( modifyTimeStamp, 14  ), 'YYYYMMDDhhmmss' ) )

 

and it properly returns 6/19/2018 7:55:46 AM as desired.

View solution in original post

1 Reply
kevinpintokpa
Creator II
Creator II
Author

I found that I had to:

a) Trim off any extraneous characters

b) Wrap the expression in another Timestamp function.

So this finally works:

Timestamp ( Timestamp# ( Left ( modifyTimeStamp, 14  ), 'YYYYMMDDhhmmss' ) )

 

and it properly returns 6/19/2018 7:55:46 AM as desired.