🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4213

Re: mktime murk

#4213
From: Larry Jones
Date: Tue, 10 Oct 1995 15:28
26 lines
1972 bytes
In article <45bj5r$pku@ae-sun01.alden.com>, sgr@ae-sun01.alden.com (Stan Ryckman) writes:
> I would think that it is impossible to satisfy a presumption for
> 1996-04-07 02:30:00 E?T
> where "?" is "D" or "S", for example.  That time does not exist
> in the U.S. (except in areas that are on year-round EST).
> [Or is it 01:30?  Now I've forgotten the exact rule  :-(  ]

My point was that a presumption is taking something for granted; a
presumption may be correct or incorrect, but it's not something to be
satisfied.  When you ask mktime to convert 1996-04-07 01:30:00 EST, it
presumes that Daylight Saving Time is/was not in effect then, consults
its DST rules, finds that DST *should* be in effect, and canonicalizes
the time to 1996-04-07 02:30:00 EDT.  Similarly, when you ask mktime to
convert 1996-04-07 01:30:00 EDT, it presumes that DST is/was in effect
then, consults the rules, finds that is should not be, and canonicalizes
to 1996-04-07 00:30:00 EST.  If you ask mktime to convert 1996-04-07
01:30:00 E?T (i.e., tm_isdst == -1), them mktime has a quandry since
neither 01:30:00 EST nor 01:30:00 EDT actually exists.  In that case
mktime is at liberty to arbitrarily pick one or the other, or to fail.
The case for 1995-10-29 01:30:00 E?T where both 01:30:00 EST and
01:30:00 EDT exist is similar.
----
Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
larry.jones@sdrc.com
Let's pretend I already feel terrible about it, and that you
don't need to rub it in any more. -- Calvin
Technical Details
Message-ID: <45e3fp$or7@info1.sdrc.com>
Path: arc1-ca.pugleaf.net!sdrc.com!thor!scjones
References: <44mio5$63n@mark.ucdavis.edu> <812657476snz@genesis.demon.co.uk> <45bj5r$pku@ae-sun01.alden.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sdrc.com!thor!scjones
From: larry.jones@sdrc.com (Larry Jones)
Newsgroups: comp.std.c
Subject: Re: mktime murk
Date: 10 Oct 1995 15:28:57 GMT
Organization: SDRC Engineering Services
Distribution: world
Message-ID: <45e3fp$or7@info1.sdrc.com>
References: <44mio5$63n@mark.ucdavis.edu> <812657476snz@genesis.demon.co.uk> <45bj5r$pku@ae-sun01.alden.com>
NNTP-Posting-Host: thor.sdrc.com
Originator: scjones@thor