13.8 \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 for the 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).

See Command line input, to force the date to a given value from the command line.


Unofficial LaTeX2e reference manual