# MrNetTek # eddiejackson.net # 6/7/2021 # free for public use # free to claim as your own Clear-Host # LOCAL # Get Local Time $ThisTime = [System.DateTime]::Now if ([System.TimeZoneInfo]::Local.IsDaylightSavingTime($ThisTime)) { $Tzn = [System.TimeZoneInfo]::Local.DaylightName } else { $Tzn = [System.TimeZoneInfo]::Local.StandardName } # Display "Time in {0} zone: {1}" -f $Tzn, $ThisTime Write-Host # TOKYO # Get Tokyo Standard Time zone $Tst = [System.TimeZoneInfo]::FindSystemTimeZoneById("Tokyo Standard Time") $TstTime = [System.TimeZoneInfo]::ConvertTime($ThisTime, [TimeZoneInfo]::local, $Tst) $Tstzn = if ([System.TimeZoneInfo]::Local.IsDaylightSavingTime($TstTime)) { $Tst.DaylightName} else {$Tst.StandardName } # Display "Time in {0} zone: {1}" -f $Tstzn,$TstTime Write-Host # INDIA # Get India Standard Time zone $Tst = [System.TimeZoneInfo]::FindSystemTimeZoneById("India Standard Time") $TstTime = [System.TimeZoneInfo]::ConvertTime($ThisTime, [TimeZoneInfo]::local, $Tst) $Tstzn = if ([System.TimeZoneInfo]::Local.IsDaylightSavingTime($TstTime)) { $Tst.DaylightName} else {$Tst.StandardName } # Display "Time in {0} zone: {1}" -f $Tstzn,$TstTime Write-Host