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 11:06 AM
When you get the value of a date/time field in a server script (Business Rule, Script Include,...) it will be in the system format (and UTC timezone) which expresses the time in the 24 hour format to alleviate this concern. All of the GlideDateTime methods use the same time format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2023 12:50 PM - edited ‎10-10-2023 12:51 PM
Hello @Brad Bowman ,
If I have a "time" type field named as due time, how can I access its value? If that field's value matches the current time, I want to send a notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2023 01:07 PM
In a server script, both the value of a time type field, and the getTime method of the GlideDateTimeAPI express the system time in the format 1970-01-01 hh:mm:ss so this script
var nowt = new GlideDateTime().getTime();
gs.addInfoMessage( 'now: ' + nowt + ' time field: ' + current.u_time);
Run at 16:05 EDT with a value of 12:50:13 (Eastern Time in my User Profile preferences) showing in the time field displays the message
now: 1970-01-01 20:05:00 time field: 1970-01-01 17:50:13
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2023 01:14 PM
@Brad Bowman sorry I did not get you properly what exactly you are telling to me.how can we check due time matches with our current or not?if its matches we have send notification on due time do I need write script or using configuration I can achieve this .please guide me on this .to be honest spent a lot of time on it but still not able to solve it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2023 04:40 AM
This depends on what you are doing to trigger this action to compare - is there a timer or Run Script on a workflow, a step in a Flow, or are you running a scheduled job,...
You can send notifications with an event, so the above understanding of getting the value of the now time and a time field is necessary to know when to fire the event.