🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2206

Re: timezone info left out of time.h?

#2206
From: Paul D. Smith
Date: Mon, 05 Oct 1992 15:47
46 lines
2926 bytes
[] Regarding Re: timezone info left out of time.h?;
[] diamond@jit345.bad.jit.dec.com (Norman Diamond) writes:

    nd> In article <PDS.92Oct1193222@lemming.webo.dg.com>
    nd> pds@lemming.webo.dg.com (Paul D. Smith) writes:

    >the standard allows an implementation to either be aware of
    >timezone info or not (by setting tm_isdst to a negative value and
    >returning NULL from gmtime).  [...] does anyone have any opinions
    >on why some method of determining the local timezone displacement
    >from UTC was not included in the standard?

    nd> Your local timezone displacement (in Massachusetts) now is -4
    nd> hours but next month will be -5 hours.  It is only meaningful
    nd> to compute local time for a particular instant of time.

And your point is? :)

It is quite obvious that this is the case, which is why you usually
see "EDT" or "EST" or some such appended to a time statement--I'm not
sure I get the point but I assume you mean that providing a global
variable or function which returns the local TZ displacement is not
necessarily accurate if used across DST boundaries?

If the standard allows you to calculate local time, then it should
provide a method of determining the offset of that time from UTC.
That seems only reasonable.  In this day and age of multi-national
standards, email, etc. a time statement like "12:43:23" is less than
useless, it's very likely misleading.

I agree that there are problems with a scheme like a global variable,
although I can easily think of at least one way of working around
them; I much prefer an added field to struct tm specifying the
displacement.  I just can't understand why such a thing was omitted,
since there is precedent for allowing "invalid values" for systems
which can't determine this offset.
--

                                                                paul
-----
 ------------------------------------------------------------------
| Paul D. Smith                          |    paul_smith@dg.com    |
| Data General Corp.                     | pds@lemming.webo.dg.com |
| Network Systems Development Division   |                         |
| Open Network Systems Development       |   "Pretty Damn S..."    |
 ------------------------------------------------------------------
Technical Details
Message-ID: <PDS.92Oct5114725@lemming.webo.dg.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!gatech!rpi!psinntp!psinntp!dg-rtp!webo!dg-webo!pds
References: <PDS.92Oct1193222@lemming.webo.dg.com> <1992Oct3.042403.1567@nntpd.lkg.dec.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!gatech!rpi!psinntp!psinntp!dg-rtp!webo!dg-webo!pds
From: pds@lemming.webo.dg.com (Paul D. Smith)
Subject: Re: timezone info left out of time.h?
Sender: usenet@webo.dg.com (Usenet Administration)
Message-ID: <PDS.92Oct5114725@lemming.webo.dg.com>
In-Reply-To: diamond@jit345.bad.jit.dec.com's message of 3 Oct 92 04:24:03 GMT
Date: 05 Oct 92 15:47:25 GMT
Lines: 46
References: <PDS.92Oct1193222@lemming.webo.dg.com>
 <1992Oct3.042403.1567@nntpd.lkg.dec.com>
Organization: NSDD/ONSD, Data General Corp., Westboro, MA
Lines: 46