# How do I insert yesterdays date instead of today? [duplicate]

I usually generate a report for the previous day (as I imagine isn't all too uncommon) and so I'd like to date it with yesterday's date instead of today. Currently I have:

\title{foo}
\date{\today}


But I can't seem to find a \yesterday or anything beyond simple formatting in packages like datetime - is there a simple way to get this?

There's an old but working package: advdate:

\documentclass{article}

\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}

\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}


• This worked! Thanks. I tried googling for how to do this and was surprised not to find something given how common it probably is to do this. – Palace Chan Oct 14 '15 at 14:31
\documentclass{article}
\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}

• Oh the overloaded - is so nicely confusing :-) – yo' Oct 14 '15 at 15:19
• @yo' Yes, I forgot on my first attempt that I needed the + before -1. That's the pgfcalendar syntax which datetime2-calc uses behind the scenes :-) – Nicola Talbot Oct 14 '15 at 15:33