apply

Adds the time difference between the current and the passed timezones to a new date object.

Parameters

targetDate Date

The date that will be converted with the time difference between the current and passed timezones.

offset Number|String

The offset represented as minutes (that is, the Number type) or timezone (that is, String).

Returns

Date A new date object that includes the time difference between the current and the passed timezones.

Example

<script>
  var version = kendo.version;

  $.getScript(
    "https://kendo.cdn.telerik.com/" +
      version +
      "/js/kendo.timezones.min.js",
    loadExample,
  );

  function loadExample() {
    var targetDate = new Date(2016, 10, 5, 15, 25, 11);
    var convertedDate1 = kendo.timezone.apply(targetDate, "Etc/GMT-6");
    var convertedDate2 = kendo.timezone.apply(targetDate, -360);

    /* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(convertedDate1); // Sat Nov 05 2016 23:25:11 GMT+0200 (FLE Standard Time);
    /* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(convertedDate2); // Sat Nov 05 2016 23:25:11 GMT+0200 (FLE Standard Time);
  }
</script>
In this article
apply
Not finding the help you need?
Contact Support