Force KendoDateTimePicker to accept any date and time we select irrespective of time zone

325 views Asked by At

Iam using the KendoDateTimePicker for MVC.

Currently am in GMT+0200 (Israel Standard Time) and i want to select a particular time in in KendoDateTimePicker. For e.g., say the time is 25-Mar-2022 02:00. when i select the time part as 02:00, the time part automatically skips and formats to 03:00, which i know for that datetime +1 hour daylight saving is applicable.

Although i reside in this time zone but the data i want to apply is of a different country which has the daylight saving is not applicable.

Can i somehow manage the kendoDateTimePicker date and time without affecting this daylight saving, or manage the dates in UTC (in the UI it should show the date and time correctly). Which means the picker should accept all dates and times irrespective of any time zone.

Can someone suggest any workaround to make the picker force whatever we select?

Thanks.

1

There are 1 answers

0
Aleksandar On

This post explains the date behavior with the DatePicker. Maybe you can implement logic to use UTC on the client and the server? The example is for a Grid, but I guess similar approach may work. You can also set the parseFormats configuration to specify the formats that would be acceptable. The zzz specifier in the provided format will specify how UTC dates are parsed.