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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

hours in AM/PM

Dear All,

I have to create hours from date and then want to show hours in AM/PM..

Hour(date) as Hours

resuult is 11,1,12...but I want 11AM,12PM...etc

What to do plz reply..

Rahul

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try:

Mod(Hour(DateTimeField),12)&' '&time(DateTimeField, 'TT') as Hour

Hope, there is an easier way and not just striking.

View solution in original post

8 Replies
PrashantSangle

Hi,

Use

Time(Date,'hh TT')

or

Timestamp(Date,'hh TT'))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

its give 11:22:01 AM format...but I want 11AM(which includes time from 11 to 11:59:59)...

PrashantSangle

Hi,

Try this in your text Obejct

Time(now(),'hh TT')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jyothish8807
Master II
Master II

Hi Rahul,

time(Date,'hh TT')

It will give 11 AM as output.

Regards

KC

Best Regards,
KC
Not applicable
Author

dear max,

its give result 11am,11am,3pm,3pm....... but I want result having distinct hours ... 11am,3am,4pm...

Not applicable
Author

My required result is shown in attachment ...

It should be 1AM,1PM,3AM,3PM...but not 1AM,1AM(REPEAT)...

tresesco
MVP
MVP

Try:

Mod(Hour(DateTimeField),12)&' '&time(DateTimeField, 'TT') as Hour

Hope, there is an easier way and not just striking.

Not applicable
Author

As always ...you are too good tresesco... thanks..