aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-12 15:39:22 -0400
committerChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-12 15:39:22 -0400
commit3df0a96fc218c9bb69bb1285025e1baf22924427 (patch)
tree20f16bae39d7500711aa7d0b0b6d8e4d3dd83fb8
parentfix tm_from_dict year bug (diff)
investigating...
-rw-r--r--TECH.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/TECH.md b/TECH.md
index f2bbb27..c148163 100644
--- a/TECH.md
+++ b/TECH.md
@@ -16,3 +16,11 @@ The implication (which is accurate) implies that `gmtime(t) == gmtime(mktime(loc
As such, the source of truth is `time_t`, which is UTC-only.
When we want to modify a `time_t`, we want to use localtime to perform the modification.
+
+`strftime` actually can handle a `gmtime`, but various platforms are buggy.
+For example, macOS `%z %Z` will correctly report UTC but will report the localtime offset.
+On Linux, the same format will correctly report an offset of exactly `+0000`, but claim to be in `GMT`.
+As such, `%z` and `%Z` cannot be counted on.
+
+Ok, `%z` and `%Z` don't work correctly because `struct tm` is often extended.
+When I convert to and from a dictionary, I lose that information.