Edit this page

convert

Adds the time difference between two timezones to a new date object.

Parameters

targetDate Date

The date that will be converted with the time difference between two timezones.

fromOffset Number |String

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

toOffset Number |String

The 'to' 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 two timezones.

Example

<script>
    var targetDate = new Date(2016,10,5,15,25,11);
    var convertedDate1 = kendo.timezone.convert(targetDate, "Etc/GMT+2", "Etc/GMT-6");
    var convertedDate2 = kendo.timezone.convert(targetDate, 120, -360);
    console.log(convertedDate1); // Sat Nov 05 2016 23:25:11 GMT+0200 (FLE Standard Time)
    console.log(convertedDate2); // Sat Nov 05 2016 23:25:11 GMT+0200 (FLE Standard Time)
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy