Getting 1970-01-03 12:13:00 as a output when accessing values from glideduration type field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2023 01:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2023 05:37 AM
Hi Mark,
This value indicates a duration of 2 days 12 hours 13 minutes. What is an example of the format you are looking for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2023 06:36 AM
Suppose today is 10-10-2023 at 12:13:00 as per duration of the repeat field our output should be 12-10-23 00:26:00 I hope you got my requiremnt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2023 07:45 AM
This will add the duration value to the current date and time:
var nowdt = new GlideDateTime();
nowdt.getDisplayValue;
var dur = current.u_dur_name.dateNumericValue(); //name of your duration field
nowdt.add(dur);
gs.addInfoMessage(nowdt.getDisplayValue());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2023 10:31 AM
Hello @Brad Bowman ,
it's working fine. Thank you so much. Just one doubt: can I compare two date times, including AM and PM? In my requirement, there is one custom field named "future schedule date." When the future schedule date matches the current date and time, I want to send a notification. I know the "equals" method, but I think that method will not compare AM and PM. How can I compare, please guide me. It will be really helpful for me.
Thank you once again.