Skip to content

Calendar.ChangeTimeZone

Overview

DateTimeOffset Calendar.ChangeTimeZone ( dateTime, timeZone )
Returns a new date time of specified date time at the zone offset.

Arguments

DateTimeOffset dateTime Specifies the base date time value.

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

Remarks

Examples

var currentDate = $Calendar.Today;
$Xml.SetValue('CurrentDate', currentDate);
$Xml.SetValue('ChangedDate', $Calendar.ChangeTimeZone(currentDate, '02:00'));
Result is

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

See Also