bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Re: date timezone question


From: Paul Eggert
Subject: Re: [PATCH] Re: date timezone question
Date: Sat, 08 May 2004 21:53:52 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

address@hidden writes:

> OK I've attached a patch that addresses question 1 above.
> Note this is not for merging, just for disussion really.

The user-interface change sounds good, but the implementation isn't
quite right.  You need to temporarily set TZ all the while mktime is
being run; it isn't correct merely to try to find the current UTC
offset for the time zone, as the UTC offset may be different at the
requested date than it is currently (due to political change, or
daylight-saving time, or whatever).

Also: Don't rely on snprintf (use asnprintf instead).  Don't use
tzname or timezone (they're not portable, and besides you don't need
them once you get TZ and mktime right).  Avoid arbitrary limits like
256, as POSIX time zone names can be arbitrarily long (and, while
we're on the subject TZ can contain "<", ">", "-", "+", and digits;
for details see
<http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html#tag_08_03>
and look for TZ).

Finally, the change needs to be documented accurately and clearly in
doc/getdate.texi.  (This is perhaps the hardest part.  :-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]