summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/piff/time.sty
blob: df9f094031cbcbf023a42e70996a7e1ac0a09210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
\def\filename{time.sty}
\def\fileversion{1.0a}
\def\filedate{15 Feb 1995 10:55:01 BST}
%% This is time.sty
%% Copyright (C) 1995 Mike Piff
%%
%% This file is placed in the public domain.  No provision is made for
%% support of the use of the facilities herein.
%%
%%   M.Piff@sheffield.ac.uk
%%
\typeout{\filename\space v\fileversion, (C) Copyright Mike Piff, \filedate}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{time}
\def\now{{%
   \def\Time{3}%
   \def\Hour{4}%
   \def\Minute{5}%
   \count\Time=\time\relax
   \ifnum\count\Time=0
      \count\Time=1440 %%force 12pm
   \fi
   \count\Hour=\count\Time\relax
   \divide\count\Hour by 60\relax%%hours past midnight
   \count\Minute=\count\Hour\relax
   \multiply\count\Minute by -60\relax
   \advance\count\Minute by \count\Time\relax %%minutes past hour
   \ifnum\count\Hour=0
      \count\Hour=12
   \else
      \ifnum\count\Hour>12
         \advance\count\Hour by-12
      \fi
   \fi
   \the\count\Hour\relax:%
   \ifnum\count\Minute<10
      0%
   \fi
   \the\count\Minute\relax
   \ifnum\count\Time>720
      pm%
   \else
      am%
   \fi
}}