home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / text / tex / 10440 < prev    next >
Encoding:
Internet Message Format  |  1992-08-23  |  1.4 KB

  1. Path: sparky!uunet!usna!dfr
  2. From: dfr@usna.navy.mil (PROF D. Rogers (EAS FAC))
  3. Newsgroups: comp.text.tex
  4. Subject: Re: A macro for giving the current time of day.
  5. Message-ID: <2064@usna.NAVY.MIL>
  6. Date: 24 Aug 92 00:54:49 GMT
  7. References: <455@muller.loria.fr>
  8. Sender: news@usna.NAVY.MIL
  9. Organization: U. S. Naval Academy
  10. Lines: 32
  11.  
  12. In article <455@muller.loria.fr> roegel@loria.fr (Roegel Denis) writes:
  13. !It seems to me that there were still three little mistakes in what sent
  14. !Duncan Farrow and Donald Arsenau:
  15. !
  16. !
  17. !
  18. !\newcount\hour \newcount\minute
  19. !\def\now{\ifnum\time<60       %check to see if it's just after midnight
  20. !          12:\ifnum\time<10 0\fi\number\time am %and act accordingly.
  21. !         \else
  22. !            \ifnum\time!719\chardef\a=`p\else\chardef\a=`a\fi 
  23. !%%% backquotes here ------------------^  and -----------^
  24. !
  25. !          \hour=\time
  26. !                          \minute=\time 
  27. !%%% that was forgotten ---^^^^^^^^^^^^^^
  28. !
  29. !          \divide\hour by 60 %\hour is the result of an integer divide
  30. !          \ifnum\hour!12\advance\hour by -12\advance\minute by-720 \fi
  31. !          \number\hour:%
  32. !          \multiply\hour by 60 %Use is made of the integer divide here.
  33. !          \advance\minute by -\hour
  34. !          \ifnum\minute<10 0\fi\number\minute\a m\fi}
  35. !
  36. !It works fine and it is so easy !
  37. !
  38. !Denis (roegel@loria.fr)
  39.  
  40. How about someone posting the complete corrected macro?
  41.  
  42. Dave Rogers
  43.  
  44.