diff --git a/libc/time/localtime.c b/libc/time/localtime.c index 8d6709afc..da9492ae2 100644 --- a/libc/time/localtime.c +++ b/libc/time/localtime.c @@ -20,18 +20,19 @@ STATIC_YOINK("zipos"); STATIC_YOINK("usr/share/zoneinfo/"); STATIC_YOINK("usr/share/zoneinfo/Anchorage"); -STATIC_YOINK("usr/share/zoneinfo/Beijing"); STATIC_YOINK("usr/share/zoneinfo/Berlin"); -STATIC_YOINK("usr/share/zoneinfo/Boulder"); STATIC_YOINK("usr/share/zoneinfo/Chicago"); +STATIC_YOINK("usr/share/zoneinfo/Denver"); STATIC_YOINK("usr/share/zoneinfo/GMT"); -STATIC_YOINK("usr/share/zoneinfo/GST"); STATIC_YOINK("usr/share/zoneinfo/Honolulu"); -STATIC_YOINK("usr/share/zoneinfo/Israel"); -STATIC_YOINK("usr/share/zoneinfo/Japan"); +STATIC_YOINK("usr/share/zoneinfo/Jerusalem"); +STATIC_YOINK("usr/share/zoneinfo/Kolkata"); +STATIC_YOINK("usr/share/zoneinfo/Los_Angeles"); STATIC_YOINK("usr/share/zoneinfo/London"); -STATIC_YOINK("usr/share/zoneinfo/Melbourne"); STATIC_YOINK("usr/share/zoneinfo/New_York"); +STATIC_YOINK("usr/share/zoneinfo/Shanghai"); +STATIC_YOINK("usr/share/zoneinfo/Sydney"); +STATIC_YOINK("usr/share/zoneinfo/Tokyo"); STATIC_YOINK("usr/share/zoneinfo/UTC"); // clang-format off diff --git a/test/libc/time/strftime_test.c b/test/libc/time/strftime_test.c index 18684fb0e..4891a9ede 100644 --- a/test/libc/time/strftime_test.c +++ b/test/libc/time/strftime_test.c @@ -24,7 +24,7 @@ #include "libc/time/time.h" textstartup static void strftime_test_init(void) { - setenv("TZ", "GST", true); + setenv("TZ", "Los_Angeles", true); } const void *const strftime_test_ctor[] initarray = {strftime_test_init}; @@ -58,20 +58,20 @@ TEST(strftime_100, rfc822_ShakaZuluTime) { FormatTime("%a, %d %b %y %T %z", gmtime(&t))); } -TEST(strftime_201, iso8601_GoogleStandardTime) { +TEST(strftime_201, iso8601_LosAngeles) { int64_t t = 0x5cd04d0e; - ASSERT_STREQ("GST", getenv("TZ")); + ASSERT_STREQ("Los_Angeles", getenv("TZ")); ASSERT_STREQ("2019-05-06T08:04:46PDT", FormatTime("%Y-%m-%dT%H:%M:%S%Z", localtime(&t))); } -TEST(strftime_201, rfc2822_GoogleStandardTime) { +TEST(strftime_201, rfc2822_LosAngeles) { int64_t t = 0x5cd04d0e; ASSERT_STREQ("Mon, 06 May 2019 08:04:46 -0700", FormatTime("%a, %d %b %Y %T %z", localtime(&t))); } -TEST(strftime_201, rfc822_GoogleStandardTime) { +TEST(strftime_201, rfc822_LosAngeles) { int64_t t = 0x5cd04d0e; ASSERT_STREQ("Mon, 06 May 19 08:04:46 -0700", FormatTime("%a, %d %b %y %T %z", localtime(&t))); diff --git a/third_party/python/Lib/test/test_time.py b/third_party/python/Lib/test/test_time.py index 44e82ebd5..b9b5e08a5 100644 --- a/third_party/python/Lib/test/test_time.py +++ b/third_party/python/Lib/test/test_time.py @@ -295,20 +295,20 @@ class TimeTestCase(unittest.TestCase): # http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html # They are also documented in the tzset(3) man page on most Unix # systems. - # eastern = 'EST+05EDT,M4.1.0,M10.5.0' # [jart] wut - # victoria = 'AEST-10AEDT-11,M10.5.0,M3.5.0' + # new_york = 'EST+05EDT,M4.1.0,M10.5.0' # [jart] wut + # sydney = 'AEST-10AEDT-11,M10.5.0,M3.5.0' # utc='UTC+0' utc = 'UTC' - eastern = 'New_York' - victoria = 'Melbourne' + new_york = 'New_York' + sydney = 'Sydney' org_TZ = environ.get('TZ',None) try: # Make sure we can switch to UTC time and results are correct # Note that unknown timezones default to UTC. # Note that altzone is undefined in UTC, as there is no DST - environ['TZ'] = eastern + environ['TZ'] = new_york time.tzset() environ['TZ'] = utc time.tzset() @@ -320,7 +320,7 @@ class TimeTestCase(unittest.TestCase): self.assertEqual(time.localtime(xmas2002).tm_isdst, 0) # Make sure we can switch to US/Eastern - environ['TZ'] = eastern + environ['TZ'] = new_york time.tzset() self.assertNotEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) self.assertEqual(time.tzname, ('EST', 'EDT')) @@ -332,7 +332,7 @@ class TimeTestCase(unittest.TestCase): self.assertEqual(len(time.tzname), 2) # Now go to the southern hemisphere. - environ['TZ'] = victoria + environ['TZ'] = sydney time.tzset() self.assertNotEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) diff --git a/tool/net/definitions.lua b/tool/net/definitions.lua index 37e842fc6..17d5119ce 100644 --- a/tool/net/definitions.lua +++ b/tool/net/definitions.lua @@ -7071,21 +7071,21 @@ function unix.gmtime(unixts) end --- --- Your redbean ships with a subset of the time zone database. --- ---- - `/zip/usr/share/zoneinfo/Honolulu` Z-10 ---- - `/zip/usr/share/zoneinfo/Anchorage` Z -9 ---- - `/zip/usr/share/zoneinfo/GST` Z -8 ---- - `/zip/usr/share/zoneinfo/Boulder` Z -6 ---- - `/zip/usr/share/zoneinfo/Chicago` Z -5 ---- - `/zip/usr/share/zoneinfo/New_York` Z -4 ---- - `/zip/usr/share/zoneinfo/UTC` Z +0 ---- - `/zip/usr/share/zoneinfo/GMT` Z +0 ---- - `/zip/usr/share/zoneinfo/London` Z +1 ---- - `/zip/usr/share/zoneinfo/Berlin` Z +2 ---- - `/zip/usr/share/zoneinfo/Israel` Z +3 ---- - `/zip/usr/share/zoneinfo/India` Z +5 ---- - `/zip/usr/share/zoneinfo/Beijing` Z +8 ---- - `/zip/usr/share/zoneinfo/Japan` Z +9 ---- - `/zip/usr/share/zoneinfo/Sydney` Z+10 +--- - `/zip/usr/share/zoneinfo/Honolulu` Z-10 +--- - `/zip/usr/share/zoneinfo/Anchorage` Z-09/-08 +--- - `/zip/usr/share/zoneinfo/Los_Angeles` Z-08/-07 +--- - `/zip/usr/share/zoneinfo/Denver` Z-07/-06 +--- - `/zip/usr/share/zoneinfo/Chicago` Z-06/-05 +--- - `/zip/usr/share/zoneinfo/New_York` Z-05/-04 +--- - `/zip/usr/share/zoneinfo/UTC` Z+00 +--- - `/zip/usr/share/zoneinfo/GMT` Z+00 +--- - `/zip/usr/share/zoneinfo/London` Z+00/+01 +--- - `/zip/usr/share/zoneinfo/Berlin` Z+01/+02 +--- - `/zip/usr/share/zoneinfo/Jerusalem` Z+02/+03 +--- - `/zip/usr/share/zoneinfo/Kolkata` Z+05:30 +--- - `/zip/usr/share/zoneinfo/Shanghai` Z+08 +--- - `/zip/usr/share/zoneinfo/Tokyo` Z+09 +--- - `/zip/usr/share/zoneinfo/Sydney` Z+10/+11 --- --- You can control which timezone is used using the `TZ` environment --- variable. If your time zone isn't included in the above list, you diff --git a/tool/net/help.txt b/tool/net/help.txt index 84db6da0c..9ffdc83bb 100644 --- a/tool/net/help.txt +++ b/tool/net/help.txt @@ -4586,21 +4586,21 @@ UNIX MODULE Your redbean ships with a subset of the time zone database. - - `/zip/usr/share/zoneinfo/Honolulu` Z-10 - - `/zip/usr/share/zoneinfo/Anchorage` Z -9 - - `/zip/usr/share/zoneinfo/GST` Z -8 - - `/zip/usr/share/zoneinfo/Boulder` Z -6 - - `/zip/usr/share/zoneinfo/Chicago` Z -5 - - `/zip/usr/share/zoneinfo/New_York` Z -4 - - `/zip/usr/share/zoneinfo/UTC` Z +0 - - `/zip/usr/share/zoneinfo/GMT` Z +0 - - `/zip/usr/share/zoneinfo/London` Z +1 - - `/zip/usr/share/zoneinfo/Berlin` Z +2 - - `/zip/usr/share/zoneinfo/Israel` Z +3 - - `/zip/usr/share/zoneinfo/India` Z +5 - - `/zip/usr/share/zoneinfo/Beijing` Z +8 - - `/zip/usr/share/zoneinfo/Japan` Z +9 - - `/zip/usr/share/zoneinfo/Sydney` Z+10 + - `/zip/usr/share/zoneinfo/Honolulu` Z-10 + - `/zip/usr/share/zoneinfo/Anchorage` Z-09/-08 + - `/zip/usr/share/zoneinfo/Los_Angeles` Z-08/-07 + - `/zip/usr/share/zoneinfo/Denver` Z-07/-06 + - `/zip/usr/share/zoneinfo/Chicago` Z-06/-05 + - `/zip/usr/share/zoneinfo/New_York` Z-05/-04 + - `/zip/usr/share/zoneinfo/UTC` Z+00 + - `/zip/usr/share/zoneinfo/GMT` Z+00 + - `/zip/usr/share/zoneinfo/London` Z+00/+01 + - `/zip/usr/share/zoneinfo/Berlin` Z+01/+02 + - `/zip/usr/share/zoneinfo/Jerusalem` Z+02/+03 + - `/zip/usr/share/zoneinfo/Kolkata` Z+05:30 + - `/zip/usr/share/zoneinfo/Shanghai` Z+08 + - `/zip/usr/share/zoneinfo/Tokyo` Z+09 + - `/zip/usr/share/zoneinfo/Sydney` Z+10/+11 You can control which timezone is used using the `TZ` environment variable. If your time zone isn't included in the above list, you diff --git a/usr/share/zoneinfo/Boulder b/usr/share/zoneinfo/Denver similarity index 100% rename from usr/share/zoneinfo/Boulder rename to usr/share/zoneinfo/Denver diff --git a/usr/share/zoneinfo/Israel b/usr/share/zoneinfo/Jerusalem similarity index 100% rename from usr/share/zoneinfo/Israel rename to usr/share/zoneinfo/Jerusalem diff --git a/usr/share/zoneinfo/India b/usr/share/zoneinfo/Kolkata similarity index 100% rename from usr/share/zoneinfo/India rename to usr/share/zoneinfo/Kolkata diff --git a/usr/share/zoneinfo/GST b/usr/share/zoneinfo/Los_Angeles similarity index 100% rename from usr/share/zoneinfo/GST rename to usr/share/zoneinfo/Los_Angeles diff --git a/usr/share/zoneinfo/Melbourne b/usr/share/zoneinfo/Melbourne deleted file mode 100644 index ec8dfe038..000000000 Binary files a/usr/share/zoneinfo/Melbourne and /dev/null differ diff --git a/usr/share/zoneinfo/Beijing b/usr/share/zoneinfo/Shanghai similarity index 100% rename from usr/share/zoneinfo/Beijing rename to usr/share/zoneinfo/Shanghai diff --git a/usr/share/zoneinfo/Singapore b/usr/share/zoneinfo/Singapore deleted file mode 100644 index 785836666..000000000 Binary files a/usr/share/zoneinfo/Singapore and /dev/null differ diff --git a/usr/share/zoneinfo/Japan b/usr/share/zoneinfo/Tokyo similarity index 100% rename from usr/share/zoneinfo/Japan rename to usr/share/zoneinfo/Tokyo