Keep underlying value in UTC

When using `<ejs-datetimepicker>` when I provide it a value as a string in UTC, for example: `2021-04-03T21:25:48Z` it correctly displays the datetime in the browser's local timezone. However, when the user modifies the date using the interface, it updates the `v-model` value into the local browser's timezone, instead of keeping it in UTC.

Is it possible to keep the underlying value in UTC the whole time?

1 Reply 1 reply marked as answer

JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team April 5, 2021 08:19 AM UTC

Hi vanpyrzericj, 

Thanks for contacting Syncfusion support. 

We checked your query of relying in UTC value instead of current timezone when changing value in DateTimepicker. We would like to know you that ejs-datetimepicker functions based on new Date() (i.e., browser’s time zone). Therefore, if you change value in Datepicker, value will be parsed based on the browser’s timezone. If you want to update the current value to UTC value, you can convert it to the UTC time. Please refer the below Stack Overflow link to convert the current timezone value to UTC value.

Stack Overflow Link        : https://stackoverflow.com/a/11964609/9133493 

Please let us know if you would require any further assistance on this.

Regards, 
Jeyanth. 


Marked as answer
Loader.
Up arrow icon