home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!ncoast!brown
- From: brown@NCoast.ORG (Stan Brown)
- Subject: Re: Finding the number of days between two dates
- Organization: Oak Road Systems, Cleveland Ohio USA
- Date: Sun, 13 Dec 1992 23:55:38 GMT
- Message-ID: <Bz82Gq.F4L@NCoast.ORG>
- References: <1fsk16INNhn0@cs.tut.fi> <1992Dec9.011317.26944@klaava.Helsinki.FI> <1992Dec10.181940.10135@linus.mitre.org>
- Lines: 29
-
- In article <1992Dec10.181940.10135@linus.mitre.org> jrv@truth.mitre.org (Van Zandt) writes:
- >In article <1992Dec9.011317.26944@klaava.Helsinki.FI> wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
- >>pjh@cs.tut.fi (Haavisto Petri) writes:
- >>>1. When using mktime(), is it necessary to set all fields of the
- >>>tm-structure to correct values?
- >>
- >>No. tm_wday and tm_yday (and tm_isdst?) are computed by mktime based
- >>on the other fields. In fact, the required fields do not have to be
- >>in their required fields either, mktime normalises them.
- >
- >The Borland docs claim their mktime() normalizes those values, but
- >it doesn't. (I'm posting a separate msg on that.) My "Osborne McGraw-Hill
- >C the Complete Reference" doesn't mention the normalization. Is it required
- >by the standard?
-
- Yes. Sec 4.12.2.3 (ISO sec 7.12.2.3, I believe) so states in
- "Description".
-
- It seems to me that people who buy books about the standard instead of
- buying the standard are engaging in false economy. If you want to know
- what the standard says, the best way to find out is to look in the
- standard. Again and again, people have posted excerpts from books that
- _claim_ to explain the standard, but have errors or omissions.
-
- --
- Stan Brown, Oak Road Systems brown@Ncoast.ORG
- Cleveland, Ohio, USA
-
- Eternal life: a threat, not a promise.
-