Skip to content

Instantly share code, notes, and snippets.

@thomasrayner
Created June 29, 2016 17:02
Show Gist options
  • Save thomasrayner/4f68b517b01f32fede8f45ed9e74f14f to your computer and use it in GitHub Desktop.
Save thomasrayner/4f68b517b01f32fede8f45ed9e74f14f to your computer and use it in GitHub Desktop.
$UTCTime = $(whatever-code-got-you-utc-time)
$strCurrentTimeZone = (Get-WmiObject win32_timezone).StandardName
$TZ = [System.TimeZoneInfo]::FindSystemTimeZoneById($strCurrentTimeZone)
$LocalTime = [System.TimeZoneInfo]::ConvertTimeFromUtc($UTCTime, $TZ)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment