
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 01:15 AM
Hi Team,
Below is the script I have written to do some time calculation
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 01:24 AM
Hi @Community Alums,
You can leverage the .getDisplayValue() method.
Or if you need to convert the value try incorporating some of the below script in yours:
var epoch = new GlideDateTime().getNumericValue(); //This gives you the value in ms..
Now if you take that value and put it in
var gdt = new GlideDateTime();
gdt.setNumericValue(epoch);
gs.print(gdt);
It will return the current date/time in UTC time.
To get the Local time you can use gs.print(gdt.getDisplayValue());
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 01:24 AM
Hi @Community Alums,
You can leverage the .getDisplayValue() method.
Or if you need to convert the value try incorporating some of the below script in yours:
var epoch = new GlideDateTime().getNumericValue(); //This gives you the value in ms..
Now if you take that value and put it in
var gdt = new GlideDateTime();
gdt.setNumericValue(epoch);
gs.print(gdt);
It will return the current date/time in UTC time.
To get the Local time you can use gs.print(gdt.getDisplayValue());
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie