W3cubDocs

/LaTeX

\day & \month & \year

LaTeX defines the counter \day for the day of the month (nominally with value between 1 and 31), \month for the month of the year (nominally with value between 1 and 12), and year \year. When TeX starts up, they are set from the current values on the system. The related command \today produces a string representing the current day (see \today).

They counters are not updated as the job progresses so in principle they could be incorrect by the end. In addition, TeX does no sanity check:

\day=-2 \month=13 \year=-4 \today

gives no error or warning and results in the output ‘-2, -4’ (the bogus month value produces no output).

© 2007–2018 Karl Berry
Public Domain Software
http://latexref.xyz/_005cday-_0026-_005cmonth-_0026-_005cyear.html