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

  1. From: chris@mimsy.umd.edu (Chris Torek)
  2. To: std-unix@sally.utexas.edu, hpfcdg!rgt%hplabs.csnet@relay.cs.net
  3. Date: Mon, 15 Dec 86 16:25:27 EST
  4.  
  5. The time string formats seem to express a fair number of similar
  6. numeric entities:
  7. ...
  8. >    %H is replaced by the hour (24-hour clock) as a decimal number
  9. >       (00 to 23)
  10. >    %I is replaced by the hour (12-hour clock) as a decimal number
  11. >       (01 to 12)
  12. ...
  13. >    %U is replaced by the week number of the year with Sunday as the
  14. >       first day of the week (00 to 52)
  15. >    %V is replaced by the week number of the year with Monday as the
  16. >       first day of the week (00 to 52)
  17. >    %w is replaced by the weekday as a decimal number [0 (Sunday) to 6]
  18. ...
  19. >    %y is replaced by the year without century (00 to 99)
  20. >    %Y is replaced by the year with century
  21.  
  22. Now, time conversion may or may not be anywhere near as complex a
  23. task as terminal control, but it seems to me that we may be repeating
  24. the mistake made with termcap, repaired in terminfo.  Rather than
  25. defining a specific set of numeric values, perhaps strftime, like
  26. terminfo, should have a small calculator built in.  Then, e.g.,
  27. `%y' and `%Y' are unnecessary.  `%y' could push the year-with-century,
  28. and `%{100}' the value 100; invoking mod (`%%'? the name may prove
  29. problematical) and `%2d' could then produce the year-without-century.
  30. -- 
  31. In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)
  32. UUCP:    seismo!mimsy!chris    ARPA/CSNet:    chris@mimsy.umd.edu
  33.  
  34. Volume-Number: Volume 8, Number 70
  35.  
  36.