TimePicker and UTC

2 posts, 0 answers
  1. Bob
    Bob avatar
    30 posts
    Member since:
    Apr 2019

    Posted 13 Feb Link to this post

    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?

  2. Missing user
    Missing user avatar

    Posted 17 Feb Link to this post

    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.

    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.
Back to Top