Date/ Time Actual and Display value time difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2023 06:13 AM
Hi,
I have tried sending Incident created Date/Time value thru Integration. Where I can able to see the display value time and backend time having 1 hour time difference. May I know the recent behind this and how can we send the time as what users seeing in incident form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2023 06:22 AM
Hi @Vishnu kumar R ,
You can select whether you want time in UTC/GMT or you want time in user time zone as they can be different
To get time you see on incident form, use Local time code as shown below
var gdt = new GlideDateTime();
gs.info(' 1. UTC Time: ' + gdt.getValue());
gs.info('2. Local Time in user time zone: ' + gdt.getDisplayValue()); // Local TZ for this example is America/Los_Angeles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2023 06:26 AM
Hi @Vishnu kumar R ,
Try running this script after setting timezone of you profile timezone same as system timezone which would be available in system properties> Basic configuration>System timezone for all users unless overridden in the user's record. If the result still differs, then set your profile timezone as UTC and run the script. Please let me know if it works.
Amish Ranjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2023 06:28 AM
Hi @Vishnu kumar R ,
Hope you are doing well.
Display Value -Date and time in the user's format and time zone. Keep in mind when designing business rules or script includes that this method may return values in different formats for different users.
Actual Value - Show time in UTC format
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal