How to set time zone to a date/time field in change form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 01:33 AM
My requirement is to change the time zone of fields on change form (planned start date & planned enddate) based on the time zone selected. How can I achieve this? I have tried this, but I don't think there is any method client side which sets the time zone for a field. I have tried writing the onChange client script on timezone field and whenever it changes I was passing the time zone value and getting the time zone from script include but don't know how to set this to planned start date field?
I would appreciate it if anybody can advise or let me know if this can be done
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 01:39 AM
Hi,
Can you share your scripts here?
Thanks,
Sagar Pagar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 02:05 AM
Hi Sagar,
Try following server side script in your logic:
gs.print(gs.nowDateTime());
var expectedTimezoneDateTime=new GlideScheduleDateTime().convertTimeZone("CET","GMT");
//You can provide a hardcoded value as well in the function GlideScheduleDateTime("02-02-2022 03:40:67");
var convertedTimeZoneDateTime= new GlideDateTime(expectedTimezoneDateTime);
gs.print(convertedTimeZoneDateTime);
You will have to make the server side call by glide ajax to run above code on server side and then pass the converted value back to client side.
I think this will work for you.
Please mark the answer correct if it helps. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 05:10 AM
Hello,
I would like to set the time zone of the fields so that the user can select from the calendar. This is to set the time zone for the calender and I don't want the fields to be populated with that timezone's time. Please advise if there is any way we can set this for a field without populating it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 05:32 AM
Hello,
Is that a custom time zone field that you have created? I am still not sure if i got your requirement can you give another example of your use case?