
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 08:19 AM
I'm using the below script to set a date field called "Actual Completion Date". I believe the GlideDateTime is using a different time zone then the time zone it should be which is Central. Sometimes the field gets set to the current day which is correct and then other times the field is set to the next day which is incorrect. Any thought on this?
var gdt= new GlideDateTime();
current.actual_completion_date.setValue(gdt);
current.current_status = ('Complete');
current.update();
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 08:26 AM
If it is a date type field, try this
var gdt= new GlideDateTime();
current.actual_completion_date=gdt.getLocalDate();
current.current_status = ('Complete');
current.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 08:22 AM
Try this
var gdt= new GlideDateTime();
current.actual_completion_date=gdt.getValue()
current.current_status = ('Complete');
current.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 08:26 AM
If it is a date type field, try this
var gdt= new GlideDateTime();
current.actual_completion_date=gdt.getLocalDate();
current.current_status = ('Complete');
current.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 02:18 PM
Thank you, this worked for me!!