Article View: comp.text.tex
Article #1678Re: A macro for giving the current time of day.
From: Roegel Denis
Date: Sun, 23 Aug 1992 23:28
Date: Sun, 23 Aug 1992 23:28
26 lines
1274 bytes
1274 bytes
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)
Technical Details
Message-ID:
<455@muller.loria.fr>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!loria!loria.fr!roegelShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!loria!loria.fr!roegel From: roegel@loria.fr (Roegel Denis) Newsgroups: comp.text.tex Subject: Re: A macro for giving the current time of day. Message-ID: <455@muller.loria.fr> Date: 23 Aug 92 23:28:08 GMT Sender: news@news.loria.fr Organization: CRIN (CNRS) Nancy - INRIA Lorraine Lines: 26