Skip to content

Instantly share code, notes, and snippets.

@slivingston
Created May 23, 2012 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slivingston/2774377 to your computer and use it in GitHub Desktop.
Save slivingston/2774377 to your computer and use it in GitHub Desktop.
LaTeX code to generate timestamp; the resulting command is \now
%% Code to create a timestamp. The resulting command is \now
%%
%% SCL; 30 May 2012
\newcount\hour \newcount\minute
\hour=\time \divide \hour by 60
\minute=\time
\loop \ifnum \minute > 59 \advance \minute by -60 \repeat
\def\now{\number\year%
-{\ifnum \month < 10 0\fi}\number\month%
-{\ifnum \day < 10 0\fi}\number\day%
~{\ifnum \hour < 10 0\fi}\number\hour%
:{\ifnum \minute < 10 0\fi}\number\minute}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment