home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18300 < prev    next >
Encoding:
Text File  |  1992-12-13  |  1.8 KB  |  40 lines

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