Article View: comp.text.tex
Article #1680Re: A macro for giving the current time of day.
From: PROF D. Rogers (EAS FAC)
Date: Mon, 24 Aug 1992 00:54
Date: Mon, 24 Aug 1992 00:54
31 lines
1454 bytes
1454 bytes
In article <455@muller.loria.fr> roegel@loria.fr (Roegel Denis) writes:
!It seems to me that there were still three little mistakes in what sent
!Duncan Farrow and Donald Arsenau:
!
!
!
!\newcount\hour \newcount\minute
!\def\now{\ifnum\time<60 %check to see if it's just after midnight
! 12:\ifnum\time<10 0\fi\number\time am %and act accordingly.
! \else
! \ifnum\time!719\chardef\a=`p\else\chardef\a=`a\fi
!%%% backquotes here ------------------^ and -----------^
!
! \hour=\time
! \minute=\time
!%%% that was forgotten ---^^^^^^^^^^^^^^
!
! \divide\hour by 60 %\hour is the result of an integer divide
! \ifnum\hour!12\advance\hour by -12\advance\minute by-720 \fi
! \number\hour:%
! \multiply\hour by 60 %Use is made of the integer divide here.
! \advance\minute by -\hour
! \ifnum\minute<10 0\fi\number\minute\a m\fi}
!
!It works fine and it is so easy !
!
!Denis (roegel@loria.fr)
How about someone posting the complete corrected macro?
Dave Rogers
Technical Details
Message-ID:
<2064@usna.NAVY.MIL>Path:
arc1-ca.pugleaf.net!sparky!uunet!usna!dfrReferences:
<455@muller.loria.fr>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usna!dfr From: dfr@usna.navy.mil (PROF D. Rogers (EAS FAC)) Newsgroups: comp.text.tex Subject: Re: A macro for giving the current time of day. Message-ID: <2064@usna.NAVY.MIL> Date: 24 Aug 92 00:54:49 GMT References: <455@muller.loria.fr> Sender: news@usna.NAVY.MIL Organization: U. S. Naval Academy Lines: 32