timezone file nepal

Posted by

 in /usr/share/zoneinfo/

https://archlinux.org/packages/core/x86_64/tzdata/files/

binaries : zdump, zic

https://www.iana.org/time-zones


for nepal 

base64 -d << 'EOF' > /etc/localtime VFppZjIAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAYAAFDcAAArMDU0NQAAAFRaaWYyAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAAGAABQ3AAAKzA1NDUAAAAKPCswNTQ1Pi01OjQ1Cg== EOF


cat /etc/localtime 
TZif2P�+0545TZif2P�+0545
<+0545>-5:45



That binary follows the RFC 8536 (TZif — Time Zone Information Format) specification.

https://www.rfc-editor.org/info/rfc8536/ link says its obsolete

new one is RFC 9636

https://www.rfc-editor.org/info/rfc9636/


new version 

base64 -d << 'EOF' > /etc/localtime VFppZjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAVFppZjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAYAAFDcAAArMDU0NQAKPCswNTQ1Pi01OjQ1Cg== EOF

cat /etc/localtime 
TZif2TZif2P�+0545
<+0545>-5:45

printf 'TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\6\0\0\120\334\0\0+0545\0\n<+0545>-5:45\n' > /etc/localtime


To support dates past the year 2038, a TZif2 file is split into three sequential parts: a legacy 32-bit block, a 64-bit block, and a trailing POSIX TZ string.


Every TZif block starts with a fixed 44-byte header (struct tzhead):
OffsetSizeValue in your fileMeaning
0x004 bytesTZifMagic signature identifying a timezone file
0x041 byte2 (0x32)Format version (2 = 64-bit support)
0x0515 bytes0x00...Reserved null padding bytes
0x144 bytes1 (0x00000001)tzh_ttisutcnt: Number of UT/local indicators
0x184 bytes1 (0x00000001)tzh_ttisstdcnt: Number of standard/wall indicators
0x1C4 bytes0 (0x00000000)tzh_leapcnt: Number of leap seconds
0x204 bytes0 (0x00000000)tzh_timecnt: Number of transition timestamps
0x244 bytes1 (0x00000001)tzh_typecnt: Number of local time types
0x284 bytes6 (0x00000006)tzh_charcnt: Byte length of timezone abbreviation string


Immediately following the 44-byte header (struct tzhead), the payload defines the local time offset, abbreviation, and transition flags across 14 bytes (0x2C–0x39 in V1; 0x66–0x73 in V2):


Offset (V1)SizeFieldRaw HexDecoded Value & Purpose
0x2C4 bytestt_gmtoff00 00 50 DC+20700 seconds (+05:45 UTC). Stored as a big-endian 32-bit signed integer (20700 / 3600 = +5.75 hours). Renders as PÜ in raw terminal output.
0x301 bytett_isdst000 (Standard Time). Indicates Daylight Saving Time is inactive (1 = active).
0x311 bytett_abbrind00Byte index 0. Points to the starting offset of the timezone label inside the abbreviation block.
0x326 bytesabbr2B 30 35 34 35 00"+0545\0". Null-terminated ASCII string used as the timezone display abbreviation.
0x381 bytett_isstd000 (Wall Time). Matches tzh_ttisstdcnt; specifies whether transitions are wall-clock (0) or standard time (1).
0x391 bytett_isut000 (Local Time). Matches tzh_ttisutcnt; specifies whether transitions are local (0) or Universal Time (1).


for windows

explore

regedit > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

cmd > tzutil /g

cmd > tzutil /l

ps > Get-TimeZone -ListAvailable