User Date Format and .setValue (date / time) inconsistencies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2014 08:59 AM
This script takes start_date from a record, adds 14 days and puts the result into end_date of the same record:
var inpDate = new GlideDateTime();
inpDate.setDisplayValue(chg.start_date);
inpDate.addDays (14);
chg.end_date = inpDate;
chg.update();
The funny thing is that I get the following in the form:
Start Date (start_date): 2014-02-18 17:00:29
End Date (end_date): 2014-03-04 22:00:29
The difference between the two is 14 days and 5 hours!!!!
Where is the 5 hours coming from and how can I make this work correctly?
Het bericht is bewerkt door: Carl Stoepker Updated the title to better reflect the content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2017 07:51 AM
The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: GlideDateTime
Visit http://docs.servicenow.com for the latest product documentation