one hour time difference in getdisplayvalue and getvalue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 07:51 AM
Hello Experts,
I am experiencing very strange behavior while calculating the time difference between two dates.
I am also using the schedule to exclude weekends from time calculation.
When I fetch the values of GlideDateTime objects using getDisplayvalue and subtracting those values is one hour more than the difference between those values which are fetched by using getvalue method of glidedatetime.
For example
date1 = 2020-12-02 11:22:06 and date2 = 2020-12-21 00:00:00
time difference between two dates when values fetch using getDisplayvalue is 12Days 12:37:54(HH:MM: SS)
time difference between two dates when values fetch using getvalue is 12Days 13:37:54(HH:MM: SS)
Please suggest your valuable comment on this.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 07:52 AM
I think the difference is CET and GMT or GMT and UTC
When you use getDisplayValue you get the time in the user's time zone, without it you get it in the system time(usually gmt)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 08:03 AM
I am not sure about GMT or UTC but my concern here is, both times are in the same timezone then why such a difference in calculation.
Same timezones mean, getValue gives in UTC and getdisplayvalue gives according to logged-in users timezone.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 07:54 AM
have you tried using getDisplayValueInternal() ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 08:00 AM
I have used the getDisplayValueInternal method but it's now working. it's showing a zero(0) time difference.