Skip to content

ChangeTimeZoneAsync

Returns a new DateTimeOffset with the specified time zone offset asynchronously.

1
myCalendar.ChangeTimeZoneAsync(dateTime: DateTimeOffset, timeZone: string):Promise<DateTimeOffset>

Parameters

DateTimeOffset dateTime
    Specifies the base DateTimeOffset value.

string timeZone
    Specifies the new time zone information for the date value in "hh:mm" format.

Returns

A Promise that resolves to a new DateTimeOffset value with the specified time zone offset.

Examples

Convert a date to another time zone

1
2
3
4
5
6
var now = DateTimeOffset.now;
$Xml.SetValue('CurrentDate', now);

$Calendar.ChangeTimeZoneAsync(now, '02:00').then(function (changed) {
    $Xml.SetValue('ChangedDate', changed);
});

Resulting form data

1
2
<CurrentDate>2017-01-25T15:42:47.5389149Z</CurrentDate>
<ChangedDate>2017-01-25T17:42:47.5389149+02:00</ChangedDate>

See Also