How do I insert yesterdays date instead of today?
There's an old but working package: advdate
:
\documentclass{article}
\usepackage{advdate}
\title{foo}
\date{\AdvanceDate[-1]\today} % Go back one day
\begin{document}
\maketitle
Today is \today\ but yesterday was {\AdvanceDate[-1]\today}
but we are still \today
\end{document}
Edit:
With \yesterday
and \tomorrow
commands (note the internal grouping)
\documentclass{article}
\usepackage{advdate}
\newcommand{\yesterday}{{\AdvanceDate[-1]\today}}
\newcommand{\tomorrow}{{\AdvanceDate[1]\today}}
\title{foo}
\date{\yesterday}
\begin{document}
\maketitle
\noindent Today is \today\ but yesterday was \yesterday, tomorrow will be \tomorrow,
but we are still on \today.
\end{document}
\documentclass{article}
\advance\day by -1
\begin{document}
\today
\end{document}
(created on October 14, 2015)
(But it won't work on the first of a month ... so advdate or a similar package from http://www.ctan.org/topic/date-time is better ;-))
Another possibility is to use datetime2
with the calc
option:
\documentclass{article}
\usepackage[calc]{datetime2}
\title{Sample}
\author{Me}
\date{\DTMdate{\year-\month-\day+-1}}
\begin{document}
\maketitle
\end{document}