Setting a Date-Time field with a GMT value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2015 03:50 AM
Hello all,
I'm trying to write a business rule that manipulates a date/time string always provided to us in GMT, to then populate a date-time field on a record.
I'm struggling to populate the field with the GMT time, ie it's always interpreted as the display time (local time).
Is there a function that directly sets a datetime field with the GMT time, so that the display time is then in the correct time zone?
I've tried using setValueUTC:
var dtNew = new GlideDateTime();
dtNew.setValueUTC("15-02-2011 08:00:00", "dd-MM-yyyy HH:mm:ss");
my_record.my_date_time = dtNew;
but in this case it's the display time of 'my_date_time' that ends up set to 15-02-2011 08:00:00.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2019 04:44 AM
Hi Jamie,
How did you use setValue(); Could you please update it here?
Regards,
Dipam kalita