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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time format.

Hi folks,

Can anyone advise me on how could I convert the time dimension from 24-hour to 12-hour format?

Sample script:

Time_DIM:

Load

     time(frac(time_column),'HH12:MM:SS AM/PM');

     @or

     time(frac(time_column),'HH12:MM:SS');

From Time_DIM.xls;

Thanks.

Best Regards,

R

Labels (1)
1 Solution

Accepted Solutions
arjunkrishnan
Partner - Creator II
Partner - Creator II

Hai Asok Try This One

SET TimeFormat='h:mm:ss TT';

time(frac(time_column),'$(TimeFormat)');

'h:mm:ss'--->24 hrs Format

h:mm:ss TT-->12 hrs Format->Time Value In--->AM/PM

View solution in original post

7 Replies
brijesh1991
Partner - Specialist
Partner - Specialist

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';

arjunkrishnan
Partner - Creator II
Partner - Creator II

Hai Asok Try This One

SET TimeFormat='h:mm:ss TT';

time(frac(time_column),'$(TimeFormat)');

'h:mm:ss'--->24 hrs Format

h:mm:ss TT-->12 hrs Format->Time Value In--->AM/PM

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

=Time(time_column, 'hh:mm:ss TT')

Regards,

Jagan.

er_mohit
Master II
Master II

simply use it on script side

timestamp(time_coloumn,'hh:mm:ss TT') as Time

amit_saini
Master III
Master III

Hi Ram,

Try this:

=Time(Your_Time_filed, 'hh:mm:ss TT')

Thanks,
AS

Not applicable
Author

Hi guys,

The formats you guys stated worked, but am not getting the correct output. Have a look at the screenshot below:

TimeStampProb3.jpg

Am only getting all the hours with 12 minutes  in between, its not a full 24hours cycle with 1second intervals as expected. Please advise.

Thanks.

Best Regards,

R

Not applicable
Author

Hi guys,

Its alright, found a out solution to it. Thanks!

Best Regards,

R