- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 12:11 PM - edited 11-01-2022 12:13 PM
I am getting date field values from 3rd party App through REST call in Microsoft Date format as shown below and I want to convert it into YYYY-MM-DD or any other servicenow format.
renewdate: 1641618000000
@asifnoor @Chandu12 @Ankur Bawiskar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 12:41 PM
Hi, it looks like this is not Microsoft specific and just the time in milliseconds IE Unix\epoc time since 1970-01-01 00:00:00 (creation date for the universe).
Unix Time Stamp - Epoch Converter
GlideDateTime() has the setNumericValue() for managing the conversion.
GlideDateTime | ServiceNow Developers
var renewdate = '1641618000000';
var gdt = new GlideDateTime();
gdt.setNumericValue(renewdate);
gs.info(gdt);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 12:41 PM
Hi, it looks like this is not Microsoft specific and just the time in milliseconds IE Unix\epoc time since 1970-01-01 00:00:00 (creation date for the universe).
Unix Time Stamp - Epoch Converter
GlideDateTime() has the setNumericValue() for managing the conversion.
GlideDateTime | ServiceNow Developers
var renewdate = '1641618000000';
var gdt = new GlideDateTime();
gdt.setNumericValue(renewdate);
gs.info(gdt);