• Introduction
  • Getting Started
  • Vue 2 End of Support
  • Native Components
    • Animation
    • Buttons
    • Chartsupdated
    • Conversational UInew
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Form
    • Gauges
    • Grid
    • Icons
    • Indicators
    • Inputs
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Notification
    • PDF Processing
    • Popup
    • Progress Bars
    • Scheduler
    • ScrollView
    • Tooltip
    • TreeList
    • TreeView
    • Upload
  • Wrapper Components
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • FAQ
  • Troubleshooting
New to Kendo UI for Vue? Start a free 30-day trial


The Date Math package includes a timezone database and utilities for working with dates in different timezones.


The JavaScript Date Object

In JavaScript, the Date object represents a single moment in time that is measured in milliseconds starting on 01 January, 1970 UTC. The Date objects are always created by using the current browser timezone offset.

The following example demonstrates how to construct a new Date object for a particular UTC date.

// 22 Oct 2018 12:00:00 GMT
const date = new Date(2018, 9, 22, 15, 0, 0);

The following result in the browser console shows that your current timezone offset is already applied.

> Mon Oct 22 2018 15:00:00 GMT+0300 (EEST)

JSON Serialization

The JSON.stringify and JSON.parse methods serialize dates as UTC. For example, if you convert the previously created JavaScript Date object to JSON, the output is the '"2014-02-01T10:00:00.000Z"' UTC date that was formatted by using the ISO8601 standard. The JSON serialization methods guarantee that regardless of their particular timezone offsets, the exact moment in time will be represented both in the browser and on the server.

Loading Timezone Data

The Date Math package enables you to load a timezone data for a specific city, continent, or for the whole world. This could be used for adding or removing a specific time offset from the JavaScript Date value.

  • Before you use the timezone conversion methods, pre-load all timezone details.
  • The Etc/UTC timezone is loaded by default.
  • List of time zones

To import the pre-built timezone scripts, which are generated from the Time Zone Database from the package list, use the following example:

// Load timezone data for a specific time zone
import '@progress/kendo-date-math/tz/Europe/Sofia';

// Load the timezone for a region
// The uncompressed file size is around ~150kB
import '@progress/kendo-date-math/tz/regions/Europe';

// Load all available timezone data
// Warning: The uncompressed file size is over 600kB
import '@progress/kendo-date-math/tz/all'

Timezone Calculations

To create a date in a different timezone and perform calculations, create an instance of the ZonedDate class.

While ZonedDate behaves similarly to a regular Date, it is immutable and the set* methods throw errors.

Converting Local Dates

You can create a date in a different timezone, which represents the same moment in time as a local date by using the fromLocalDate (date, timezone) method.

The following example demonstrates how to create a date in a different timezone and output it by using toString().

View Source
Change Theme:

Converting Dates with Timezones

You can create a date in any time zone by using the fromUTCDate (date, timezone) method. fromUTCDate takes a UTC date, but treats it as a date in the set timezone.

Why UTC dates instead of normal? The Date object will constrain values according to the local time zone Daylight Saving Time rules. This means that not all dates are representable as local dates. Even worse, they'll be silently corrected to the first valid date. This does not apply to the UTC part of the dates, which is making them a safe choice for representing arbitrary dates.

Converting between Timezones

To convert between timezones without creating intermediate local dates, use the toTimezone (timezone) method.

Timezone Details

The timezone scripts also provide human readable names for the Internet Assigned Numbers Authority (IANA) timezones and grouped timezone names—for example, (GMT+02) Helsinki, Sofia....

Listing All Timezones

To list all loaded timezone scripts, use the timezoneNames function.

Getting Specific Timezone Groups

To get all IANA timezones that are listed under a specific group, use the zonesPerGroup method.