- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2016 03:39 PM
/* SCRIPT */
var gr = new GlideRecord('u_xyzTable');
gr.get('4d967a180fe70200b8de46a32050e20');
gs.print('u_a_date : ' + gr.u_a_date);
var newDateValue = new GlideDateTime('2014-04-07 08:17:00');
gr.u_a_date.setGlideDateTime(newDateValue);
gr.update();
gs.print('new u_a_date : ' + gr.u_a_date);
RESULT
[0:00:00.005] Script completed in scope global: script
*** Script: u_a_date : 2014-04-06 00:00:00
*** Script: new u_a_date : 2014-04-06 00:00:00
Is this a problem with the instance or is this a bug to be fixed?
Build name: HEAD (Fuji)
Build date: 09-03-2015_1003
Build tag: glide-fuji-12-23-2014__patch8-08-25-2015
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2016 04:40 PM
The answer to this issue is in the back-end. The description of the field is shown as date instead of datetime in the SQL table. ServiceNow UI shows it is in glide DateTime but on the back-end it is only date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2016 05:13 PM
The reason of the date difference is the time zone. But we cannot identify the reason for the minutes and seconds not getting captured. Already raised a HI ticket for this issue no resolution yet.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2016 09:28 PM
Were you able to run the provided code to see if any business rules were doing anything unusual?
Were before/after different?
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2016 04:40 PM
The answer to this issue is in the back-end. The description of the field is shown as date instead of datetime in the SQL table. ServiceNow UI shows it is in glide DateTime but on the back-end it is only date.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2016 04:46 PM
So it was a Date field all along?
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022