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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert String to Timestamp

I have a string datetime property of this format: 20181030T133100.000 GMT

and I would like to format it into 30/10/2018 13:31 (DD/MM/YYYY hh:mm).

I've checked this forum: How to convert timestamp to date format

and was able to get my result by:

Date(Date#(SUBFIELD(PROPERTYDATETIME,'T',1),'YYYYMMDD'),'DD/MM/YYYY') &' '& Date(Date#(SUBFIELD(SUBFIELD(PROPERTYDATETIME,'T',2),'.',1),'hhmmss'),'hh:mm')

However, is there a better method of using the TimeStamp function of splitting the property up to format the datetime instead?

Thanks!

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

use stringfunction to get rid of text "GMT"

then use

=timestamp(date('20181030T133100.000'),'DD/MM/YYYY hh:mm') 

which gives me (you may Format to your dateformat)

View solution in original post

3 Replies
Anil_Babu_Samineni
MVP
MVP

Try this?

=Date(Date#(Replace(Field,'T',' '),'YYYYMMDD hhmmss.fff'),'DD/MM/YYYY hh:mm')


Or

=Date(Date#(Replace(SubField(Field, ' ',1),'T',' '),'YYYYMMDD hhmmss.fff'),'DD/MM/YYYY hh:mm')

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
Anonymous
Not applicable
Author

use stringfunction to get rid of text "GMT"

then use

=timestamp(date('20181030T133100.000'),'DD/MM/YYYY hh:mm') 

which gives me (you may Format to your dateformat)

Anonymous
Not applicable
Author

Thanks!

Ended up with this:

timestamp(date(SUBFIELD(PROPERTYDATETIME,' ',1)),'DD/MM/YYYY hh:mm')

was wondering if I was able to use the formatting to get rid of the gmt... but this works and much neater than mine hahas ^^