home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v6 / text0046.txt < prev    next >
Encoding:
Internet Message Format  |  1987-06-30  |  1.8 KB

  1. From: cbosgd!cbosgd.ATT.COM!mark@seismo.UUCP (Mark Horton)
  2. Date: Wed, 10 Sep 86 12:40:40 edt
  3. Organization: AT&T Bell Laboratories, Columbus
  4.  
  5. There are many uses for dates, on which you'd like to be able
  6. to do arithmetic.  I don't see where the assumption that time_t
  7. is only useful for file modification times got made.  We have
  8. an application that needs to be able to store birth dates of
  9. people living today, and of their parents.  We would like to be
  10. able to use the same format for parents' birth dates and for
  11. machine generated time stamps.  And we'd like to be able to
  12. easily add or subtract 3 hours, for example, from such a quantity.
  13.  
  14. Note that all the UNIX routines to deal with dates, such as ctime,
  15. localtime, gmtime, and asctime, deal with time_t quantities.  There
  16. are no operations provided to manipulate a struct tm.  This means
  17. there's a huge penalty for any application that needs to manipulate
  18. times that might be before 1970 or after 2038.  They must implement
  19. a set of primitives to manipulate a struct tm or other data structure
  20. (such as an ISO format time string, which is also broken into year,
  21. month, day, etc.)
  22.  
  23. Even if you offered us dates back to 1901, it wouldn't be enough for
  24. our application.  We have to go back to about 1850.  But I would hope
  25. to see some facilities added to manipulate a more general date/time
  26. format than a time_t.  Maybe the 4.2BSD struct timeval needs to have
  27. another field added to indicate a base year (defaulting to 1970.)
  28.  
  29.     Mark
  30.  
  31. [ There are manipulation (adding, subtracting) routines for timeval
  32. in the 4.2BSD kernel, by the way, though they never seem to have been
  33. brought out into a user-accessible library, even in 4.3BSD (except
  34. for timerisset, timercmp, and timerclear in <sys/time.h>).  -mod ]
  35.  
  36. Volume-Number: Volume 6, Number 47
  37.  
  38.