Skip to content

Commit 59b3582

Browse files
author
Зишан Мирза
committed
add support for tzfile version 4
1 parent 9ad6c53 commit 59b3582

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libc/src/time/timezone.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ int get_timezone_offset(char *timezone) {
7272
size_t i;
7373
__uint128_t tmp;
7474

75-
// these locations in timezone files are defined in `tzfile`
75+
// these locations in timezone files are defined in documentation
76+
// for `tzfile`
7677
magic = (hdr[0] << 24) | (hdr[1] << 16) | (hdr[2] << 8) | hdr[3];
7778
version = hdr[4];
7879
for (i = 5; i <= 20; i++) {
@@ -95,8 +96,7 @@ int get_timezone_offset(char *timezone) {
9596
return 0;
9697
}
9798

98-
// currently only supporting tzfile v2 and v3
99-
if (version != 0x32 && version != 0x33) {
99+
if (version != 0x32 && version != 0x33 && version != 0x34) {
100100
return 0;
101101
}
102102

0 commit comments

Comments
 (0)