Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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

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
Luminary Alumni
Luminary Alumni

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