glide.sys.time_format to include milliseconds???

Ryan74
Tera Contributor

Is there anyway to get milliseconds on the glide.sys.time_format, sys_properties property?

find_real_file.png

Servicenow only shows that you can do HH or hh for hour, mm for minutes, and ss for seconds in their documentation

https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/time/reference/r_...

 

Why in the world would you not be able to format to milliseconds if the value is actually stored as the number of milliseconds from Jan 1 1970. Are the created/updated datetime's etc just honestly not saving the milliseconds when the records get inserted into the tables?

find_real_file.pngfind_real_file.png

 

Without milliseconds its impossible to sort logs/events etc in time chronological order which is very important while trying to look up the sequence of events/things happening... Lol

 

Am I just missing something or does anyone know if this planned on being added in the future? 

 

Thanks

1 ACCEPTED SOLUTION

John Caruso
Kilo Guru

Milliseconds is not stored - you can look at the XML to verify.

For scoped apps there is a separate app log [syslog_app_scope] that contains a sequence field which allows correct ordering at a millisecond precision.

View solution in original post

6 REPLIES 6

SanjivMeher
Kilo Patron
Kilo Patron

I think if you convert it to integer, it will give you the milliseconds.

 

for ex

var a = new GlideDateTime();

gd.info('My Numeric value is '+a.getNumericValue());


Please mark this response as correct or helpful if it assisted you with your question.

Yes that returns a time in ms since Unix epoch, but the last three digits are always 000, which will not correctly order log entries.