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: 
brindlogcool
Creator III
Creator III

Date time conversion

Hi ,

  How to convert the 12hr format to 24hr format.

Labels (1)
5 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Hi,

First make sure your time format is set to below formats.

1.) 24hr to  12hr: 

SET TimeFormat='hh:mm:ss[.fff]';

syntax:   Timestamp('YourTimeField' ,'hh:mm:ss TT')

2.) 12hr to 24hr:

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

syntax:   Timestamp('YourTimeField' ,'hh:mm:ss')

Regards,

Phani

brindlogcool
Creator III
Creator III
Author

Thanks for your response. My Currenttimestamp is 'hh:mm:ss TT'. I have two datetime Field  one it is showing in 24 hr format. Other it is showing in the 12 hr format which is coming as the output of ConvertToLocalTime.

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Didin't understand why you were not able to convert to 24hr.

See attached if that help's....

if not throw a sample where you are not able to convert.

Regards,

Phani

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Try something like (change to the correct field name):

Time(Time#(ConvertToLocalTime(TimeValueField), 'hh:mm:ss TT'),'hh:mm:ss');

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
brindlogcool
Creator III
Creator III
Author

Thanks for all your response.