home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!emory!wupost!spool.mu.edu!agate!ucbvax!mtxinu!sybase!venky
- From: venky@sybase.com (Venky)
- Newsgroups: comp.lang.c
- Subject: Re: Finding the number of days between two dates
- Message-ID: <27537@sybase.sybase.com>
- Date: 30 Dec 92 18:15:34 GMT
- References: <1fsk16INNhn0@cs.tut.fi> <1992Dec9.011317.26944@klaava.Helsinki.FI> <1992Dec10.181940.10135@linus.mitre.org>
- Sender: news@Sybase.COM
- Organization: Sybase, Inc.
- Lines: 32
-
- 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?
- >
- > - Jim Van Zandt <jrv@mitre.org>
-
-
- ANSI Standard requires that tm_wday and tm_yday be computed
- based on the other fields in the 'struct tm'. I have seen
- that most versions of Unix do not support that, though.
-
- The latest HP-UX 9.0 however, has got this fix and works
- well. I should know.....
-
- As regards tm_isdst, the daylight savings time adjustment,
- I don't think it is implicitly calculated. It is an input
- from the user. I remember using an environment variable
- ( TZ_DST ?) to be assigned to tm_isdst ( with HP-UX ).
-
- Thanx!
- Venky
-