summaryrefslogtreecommitdiff
path: root/sys/man/2
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-09-01 19:32:45 -0700
committerOri Bernstein <ori@eigenstate.org>2020-09-01 19:32:45 -0700
commitf444d6c3f21194d8a168133e04521f0a2503aa8b (patch)
treeb34cb77e8ad896c1ff3c977a4ab393991834d0fe /sys/man/2
parente0278f69176765b408be4f29e6f3e5d39b928601 (diff)
tmparse: put in local timezone hack
Ctime is defined as printing a 3-character timezone name. The timezone name is ambiguous. For example, EST refers to both Australian and American eastern time. On top of that, we don't want to make the tzabbrev table exhaustive. So, we put in this hack: Before we consult the well known table of timezones, we check if the local time matches the timezone name. On top of that, tm2sec If you want unambiguous timezone parsing, use numeric timezone offsets (Z, ZZ formats).
Diffstat (limited to 'sys/man/2')
-rw-r--r--sys/man/2/tmdate7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/man/2/tmdate b/sys/man/2/tmdate
index 98c70eb8b..2b59649e6 100644
--- a/sys/man/2/tmdate
+++ b/sys/man/2/tmdate
@@ -114,6 +114,9 @@ and the unpadded and padded complete value, respectively.
.TP
.B Z, ZZ, ZZZ
The timezone in [+-]HHMM and [+-]HH:MM, and named form, respectively.
+If the named timezone matches the name of the local zone, then the
+local timezone will be used.
+Otherwise, we will attempt to use the named zones listed in RFC5322.
.TP
.B a, A
Lower and uppercase 'am' and 'pm' specifiers, respectively.
@@ -267,6 +270,10 @@ print("%τ", &t); /* Mon Nov 3 13:11:11 PST 2019 */
.SH BUGS
.PP
+Checking the timezone name against the local timezone is a
+dirty hack. The same date string may parse differently for
+people in different timezones.
+.PP
There is no way to format specifier for subsecond precision.
.PP
The timezone information that we ship is out of date.