How to add the seconds to the date and time ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 08:05 AM
HI,
I am running the below code in the background script , but resulting as undefined. Could someone please help me to resolve this .
var d1 = '2023-09-22 21:13:58';
var d2 = '2023-09-22 21:43:58';
var d3 = '2023-09-23 21:43:58';
var dr ;
dr = gs.dateDiff(d1,d2,true);
d3.addSeconds(dr);
gs.print('dr' + d3.getValue());
Thanks,
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 09:27 PM
Hi @snow57 ,
If my response helps you to resolve the issue Accept the solution and close it. So that others can refer and get benefited.
If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar