Notifications

11 views

Description

If you use below code will give you out put in 12 hours formatĀ 


var gdt = new GlideDateTime('2014-08-31 18:00:00');
var gt = gdt.getLocalTime();
gs.debug(gt.getByFormat('HH:mm:ss'));


OutPut : 06:00:00 // this is converted 18:00:00 to 06:00:00 which is 12 hours formatĀ 


If you use below code will give you out put in 24 hours format


var gdt = new GlideDateTime('2014-08-31 18:00:00');
var gt = gdt.getTime();
gs.debug(gt.getByFormat('HH:mm:ss'));


OutPut : 18:00:00 // which is 24 hours format.


Release or Environment

All

Article Information

Last Updated:2020-06-22 10:01:50
Published:2020-06-22