Created
March 23, 2023 15:44
-
-
Save DavoudTeimouri/6a69b70fea4722b4e218214b95589938 to your computer and use it in GitHub Desktop.
This script will decode TZI value from registry. Replace the bytes in the first line of the script with the TZI value in REG_BINARY format that you want to convert.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $tzi = [byte[]]@(0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) | |
| $bias = [System.BitConverter]::ToInt32($tzi, 0) | |
| $standardBias = [System.BitConverter]::ToInt32($tzi, 4) | |
| $daylightBias = [System.BitConverter]::ToInt32($tzi, 8) | |
| $standardStart = [System.DateTime]::FromFileTime([System.BitConverter]::ToInt64($tzi, 12)) | |
| $daylightStart = [System.DateTime]::FromFileTime([System.BitConverter]::ToInt64($tzi, 20)) | |
| Write-Host "Standard bias from UTC: $bias minutes" | |
| Write-Host "Standard offset from UTC: $standardBias minutes" | |
| Write-Host "Daylight bias from UTC: $daylightBias minutes" | |
| Write-Host "Standard start time: $standardStart" | |
| Write-Host "Daylight start time: $daylightStart" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment