DateTimeZone.SwitchZone
Syntax
DateTimeZone.SwitchZone(dateTimeZone as nullable datetimezone, timezoneHours as number, optional timezoneMinutes as nullable number) as nullable datetimezone
Om
Ändrar tidszonsinformationen för datetimezone-värdet dateTimeZone
till den nya tidszonen som tillhandahålls av timezoneHours
och eventuellt timezoneMinutes
. Om dateTimeZone
inte har någon tidszonskomponent genereras ett undantag.
Exempel 1
Ändra tidszonsinformation för #datetimezone(2010, 12, 31, 11, 56, 02, 7, 30) till 8 timmar.
Användning
DateTimeZone.SwitchZone(#datetimezone(2010, 12, 31, 11, 56, 02, 7, 30), 8)
utdata
#datetimezone(2010, 12, 31, 12, 26, 2, 8, 0)
Exempel 2
Ändra tidszonsinformation för #datetimezone(2010, 12, 31, 11, 56, 02, 7, 30) till -30 minuter.
Användning
DateTimeZone.SwitchZone(#datetimezone(2010, 12, 31, 11, 56, 02, 7, 30), 0, -30)
Utdata
#datetimezone(2010, 12, 31, 3, 56, 2, 0, -30)