This is a migrated thread and some comments may be shown as answers.

TimePicker and UTC

1 Answer 588 Views
TimePicker
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 2
Veteran
Iron
Bob asked on 13 Feb 2020, 10:57 AM

I am using the time picker to enter times.  I am in the UK and currently all times are UTC (GMT is currently UTC).

I save my values to the database and somehow Kendo has managed to subtract an hour from the saved value.

It's no problem when I bring back the values to display in the time picker, it somehow adds an hour to display the correct time.

I am working with the abp framework which has standard UTC conversion so all my values in the database are held as UTC.

But Kendo somehow has managed to find a time format which doesn't exist making it very difficult to work with.

I would post some code to further demonstrate but the option for "Formatting options" at the top of this text box simply switches the value to "Hide formatting options".

Can someone tell me what's going on?

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 17 Feb 2020, 09:34 AM

Hello Bob,

The DateInputs (both DateInput and TimePicker) work with regular JavaScript Date objects, where the date is represented as the date value in UTC time with additional info about the timezone offset. In my timezone (EET which equals UTC + 2) creating a new date would result in the following:

new Date() // Mon Feb 17 2020 11:24:09 GMT+0200 (Eastern European Standard Time)

So if an hour is subtracted from the value on your side, I do suspect the timezone options of the computer are altered to the corresponding timezone. It's just a guess though, as without some code to inspect, there isn't really that much we could do. 

I'd encourage you to send a runnable StackBlitz code examples like the following: https://stackblitz.com/edit/angular-7ymzib

If you could open the example, fork it, alter the code so that the issue is evident, and then send the page URL back, it would be really helpful.

Alternatively, create a new cli project, zip it, and send it over.

Looking forward to your reply.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TimePicker
Asked by
Bob
Top achievements
Rank 2
Veteran
Iron
Answers by
Dimitar
Telerik team
Share this question
or