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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
saif12345
Partner - Contributor
Partner - Contributor

DateTime Format

Hi,

I have this format:    01/05/2018 [07:40 PM] 

How I can convert this to Date, Year, Month, Day, Hour, Minute.

 

Thanks 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

You could purge the square brackets using purgechar() and then use parsing function date#() to make proper timestamp out of it and then extract the components you need like:

Date(Date#(Purgechar('01/05/2018 [07:40 PM]','[]'), 'DD/MM/YYYY hh:mm TT'))  as Date

....

Hour(Date#(Purgechar('01/05/2018 [07:40 PM]','[]'), 'DD/MM/YYYY hh:mm TT'))  as Hour

 

You can replace the highlighted timestamp string with your field.

 

View solution in original post

1 Reply
tresesco
MVP
MVP

You could purge the square brackets using purgechar() and then use parsing function date#() to make proper timestamp out of it and then extract the components you need like:

Date(Date#(Purgechar('01/05/2018 [07:40 PM]','[]'), 'DD/MM/YYYY hh:mm TT'))  as Date

....

Hour(Date#(Purgechar('01/05/2018 [07:40 PM]','[]'), 'DD/MM/YYYY hh:mm TT'))  as Hour

 

You can replace the highlighted timestamp string with your field.