Author: Matthew Dowst

DateTimeGeneral

Convert Between Time Zones

$DateTime = [DateTime]::SpecifyKind($date, [DateTimeKind]::Unspecified) $from = [System.TimeZoneInfo]::FindSystemTimeZoneById($FromTimeZone) $to = [System.TimeZoneInfo]::FindSystemTimeZoneById($ToTimeZone) $utc = [System.TimeZoneInfo]::ConvertTimeToUtc($DateTime, $from) [System.TimeZoneInfo]::ConvertTime($utc, $to)