home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / std / c / 2615 < prev    next >
Encoding:
Internet Message Format  |  1992-09-12  |  1.6 KB

  1. Path: sparky!uunet!usc!sdd.hp.com!swrinde!dptspd!iquery!matt
  2. From: matt@iqsc.COM (Matt Reedy)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Change to time() fn?
  5. Message-ID: <1992Sep12.140423.23672@iqsc.COM>
  6. Date: 12 Sep 92 14:04:23 GMT
  7. References: <1992Sep11.194827.19500@iqsc.COM> <1992Sep12.042747.26773@ima.isc.com>
  8. Organization: IQ Software Corp.
  9. Lines: 26
  10.  
  11. In article <1992Sep12.042747.26773@ima.isc.com> karl@ima.isc.com (Karl Heuer) writes:
  12. >ANSI doesn't specify that time() even *has* a "base value".
  13. >
  14. >POSIX says that it's measured in seconds since the Epoch, but since the
  15. >number of seconds since 1899-12-31 is already more than the common value of
  16. >LONG_MAX, I doubt that they've moved the Epoch backwards like that.
  17. >
  18. >Are you sure you're talking about the internal encoding of |time()|, and not
  19. >the |struct tm| representation?  (That *does* have an (unfortunate) base of
  20. >1900 for the |tm_year| component.)
  21.  
  22. Yes, it is the |time_t| value returned by |time()| that I'm looking at.
  23. It specifically says it is the number of seconds since midnight on 
  24. Dec 31, 1899.  And you're right, the number of seconds from that point to
  25. today is roughly 60*60*24*365*92 which is 2.9 billion.
  26.  
  27. The interesting thing about Microsoft's doc is that their example program
  28. calls this function, and does a printf("The number of seconds since 1/1/70:").
  29. So, which one is right, the comment or the sample program???
  30.  
  31. matt
  32. -- 
  33. Matthew Reedy                 UUCP: uunet!iquery!matt
  34. IQ Software Corporation       Internet: matt@iqsc.COM
  35. 400 N Loop 1604 E, Suite 100
  36. San Antonio, TX  78232        (512) 490 6684  Fax: (512) 490-3590
  37.