Same field is showing different values on form and in xml with around 2hours difference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2022 03:57 AM
Hello Team,
We have a Date/Time field called due_date on sc_req_item form.. It is showing different values in xml and on the form with 2hours difference. FYI, as per the script..xml value is correct but it has to show right time on form as well.
Attached the before insert business rule which we are using to populate that value. Could not see any field level dictionary configuration done to that field on form. For some other Date/Time fields as well, I have seen this issue. Please suggest.
- Labels:
-
Script Debugger
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2022 04:12 AM
What you show could be quite normal.
You push the value as a GlideDate. if you do that though XML it will always work in GMT/UTC timezone.
if you are in a timezone that is UTC+2 the displayed value will automaticly be ajusted to show the for your time zone related time to the UTC database time.
I said could be normal... because if your selected timezone is not UTC+2 then you have an issue, otherwise it is as designed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2022 05:00 AM
Hi,
in XML it would always show GMT value
but on form and list it would show considering logged in user's timezone or user timezone settings
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2022 05:35 AM
Hi Ankur/ Jorn van Beek,
Thanks for your replies.. But I am little confused now.. Please check below details:
In my ServiceNow settings, the timezone is Europe/oslo (which is CET timezone) and I am from Indian time zone (IST)
1. in XML , it is showing in CET time zone
2. on Form, it is showing CET+2 hours (but currently the IST timezone is CET+3:30 hours)... so it is bit unclear for me .. Can you please elaborate if this is any known issue ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2022 06:13 AM
First question, which settings did you validate?
- The system settings?
- The time zone on your user record?
If you looked at the first one, forget it, that one is of no use at this moment. This is nothing more then the default timezone for new users if not provided differently.
if you looked at the second one, then it is as it should be.
To get back to your 2 points
1. The XML if gotten by export => export as XML is in GMT/UTC not CET. 100% guarantee.
2. Since your user settings are CET you be shown the time in CET time, therefore the +2 is corrrect.
To validate this, change your timezone in ServiceNow to IST and see the time change to show time in IST.(need to reload form)