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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

get 'hour' out of 'timestamp'

Hi all,

please excuse that following silly question, but sometimes my brain is not working adequate...

How can I extract the hour ['hh'] out of an timestamp [dd.mm.yyyy hh:mm:ss] in the script?

The date does not matter, I just need to know, if it is 10am, 11am, etc.

I believe the answer is easy.

Best,

Nico

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Cheking my previous post, I'd rather use:

Hour(TimeStamp#(TimeStampField, 'dd.mm.yyyy hh:mm:ss'))


This will give you values from 0 to 23

View solution in original post

4 Replies
Miguel_Angel_Baeyens

Hello Nico,

Hour(Field)

Not applicable
Author

Hi Nico,

Go to Properties -> Number ->select the option Time and then edit format pattern as h TT.This will give time like 1 AM .

Regards,

Poorva



Miguel_Angel_Baeyens

Cheking my previous post, I'd rather use:

Hour(TimeStamp#(TimeStampField, 'dd.mm.yyyy hh:mm:ss'))


This will give you values from 0 to 23

Not applicable
Author

Thanks for the help.

I ve changed the script a little bit and finally I am not using a timestamp anymore. This is my solution.

maketime(hour(Timefield)) AS Hour