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

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.

Interesting...Just looked it up, sequence is a Counter type extending String but appears as a String representation of a DateTime with the milliseconds saved. Not really helpful for gobal/OOB but good to know something like this exists.

 

Why is this not a bigger concern for ServiceNow to start adding milliseconds to global/OOB stuff? How can we operate at a more precise level? I believe we are going to have a business need in the future to have records loaded into an import set and they will need to be transformed in chronological order where milliseconds matter. 

Good question! Allow me to predict a response: please use our new feature request system to request that enhancement. 😉

One other thing to mention is that some people solve the global scope (syslog) logging issue by adding the full datetime with ms as a prefix to the logged message text. Then you sort on the message text field to order at ms precision, rather than created on.

This will not solve your problem of the import set. I think you will need to ensure that the inbound data is presorted in the required sequence before importing/adding to the import set. It will be transformed in the order in which rows are added, and row field reflects the order of inserts as well.