How to get time from kendoDateTimePicker?

2 posts, 0 answers
  1. Tayger
    Tayger avatar
    122 posts
    Member since:
    Jan 2015

    Posted 30 Nov 2016 Link to this post


    Just working with kendoDateTimePicker... I have a startdate and an enddate, both working wit DateTimePicker. After entering both I have to evaluate if endtime is bigger than starttime. I'm able to get year, month and day by: 


    That works fine even if month (getMonth()) comes back with a month number 1 lower than expected. Example:

    January: 0 (expected: 1)
    December: 11 (expected: 12)

    It looks like that these functions starts counting the months of the year by 0 and not by 1, maybe thats wanted.

    Furthermore I don't know if I can get these values (month, day) back with two digits: "01" instead of "1"? I can handle that also in Javascript, just additional work.

    So the main question is: How can I get time out of kendoDateTimePicker (hours and minutes)? I couldn't find functions like getHour() or getMinute(). In hope it would somehow helps I have added: parseFormats: ["MMMM yyyy", "HH:mm"]


  2. Kiril Nikolov
    Kiril Nikolov avatar
    2598 posts

    Posted 02 Dec 2016 Link to this post


    The TimePicker widget works with valid JavaScript dates, so you can get just the time using this approach:

    Kiril Nikolov
    Telerik by Progress
    Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Back to Top