Referring to dates other than \today
See the datenumber and advdate packages (and the datetime package for formatting options).
Edit: Added small example, essentially stolen from the datenumber documentation.
\documentclass{article}
\usepackage{datenumber}
\begin{document}
\setdatetoday
\addtocounter{datenumber}{7}
\setdatebynumber{\thedatenumber}
Today is \today, 7 days from now it's \datedate.
\end{document}
\documentclass{article}
\makeatletter
\def\dayinmonth#1{%
\ifcase#1 31\or28\or31\or30\or31\or30
\or31\or31\or30\or31\or30\or31\fi}
\newcommand\Today[1][0]{%
\advance\day by #1
\edef\DiM{\dayinmonth{\the\month}}
\ifnum\day>\DiM
\day=\numexpr \the\day-\DiM\relax
\advance\month\@ne
\fi
\today}
\makeatother
\begin{document}
\today -- \Today[30]
\end{document}
the year can also be tested if the month is 13 after increasing
It is perhaps worth showing an example using the advdate
package, mentioned by Villemoes, as it has a single command solution for this, \DayAfter[n]
, which prints the date n days ahead and leaves \today
unchanged on exit. So for 7 days ahead:
\documentclass{article}
\usepackage{advdate}
\begin{document}
\today\\
\DayAfter[7]\\
\today\\
\end{document}
gives
August 2, 2011 August 9, 2011 August 2, 2011
the advdate
package also provides separate macros \AdvanceDate
to change the value of \today
to a number of days ahead together with \SaveDate
and \SetDate
to save and set the current value used for \today
. texdoc advdate
gives full details for these and other macros in the package, as usual.