- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 10:13 AM
I am writing a business rule on incident table.
I want to print 'Created(sys_created_on)' field's value in milliseconds.
Looking for help.
Version - Jakarta
Thank you
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 10:19 AM
you can get the number of ms since 1970-01-01 00:00:00 as an integer. is that what you are looking for?
var gdt = new GlideDateTime();
gdt.setValue(current.getValue('sys_created_on'));
var ms = gdt.getNumericValue();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 10:19 AM
you can get the number of ms since 1970-01-01 00:00:00 as an integer. is that what you are looking for?
var gdt = new GlideDateTime();
gdt.setValue(current.getValue('sys_created_on'));
var ms = gdt.getNumericValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 10:39 AM
Yes!! Thank you very much!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 11:20 AM
I recently came across a better way of doing this that even works in scoped apps:
current.sys_created_on.dateNumericValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 11:27 AM
This is awesome! Short and simple and it works!
Thank you to both of you!