Insert and format dates in LaTeX text

How to insert and format dates in LaTeX: when to use \today, fixed dates, or the datetime2 package, and how date choices affect readability, copying and accessibility.

Putting a date into a LaTeX document looks trivial. The choice still matters: some methods print whatever day the file was last compiled, while others fix the date in the source. Each also affects how the date reads to an international audience. This review covers the main options, what each one actually changes, and when typing the date as plain text is the better choice.

Short recommendation

For drafts and working notes, use \today. It is built in, needs no packages, and saves you from updating a date by hand. For anything you distribute, submit, sign or archive, type a fixed date or pass a fixed value to a date package. The decisive drawback of \today is that it is re-evaluated on every compile, so recompiling an old file next year silently changes its date. A plain typed date is also preferable when the exact wording must match another record, such as a contract, a citation or a version history.

The main ways to insert a date

\today and the \date command

\today expands to the date when the document is compiled. In the standard LaTeX kernel with default English, the format is month name, day, comma, year. A file compiled on 31 October 2026 would therefore show "October 31, 2026", which matches common US usage. The \date command sets what \maketitle prints under the title. In the standard article class, if you do not call \date at all, \maketitle falls back to \today. Writing \date{} with empty braces suppresses the date line entirely.

\documentclass{article}
\title{Quarterly Report}
\author{A. Writer}
\date{\today}        % or a fixed value, e.g. \date{October 31, 2026}
\begin{document}
\maketitle
This version was compiled on \today.
\end{document}

You can use \today anywhere in running text, as the last line of the example shows. It is not limited to the title block.

Language settings change \today

Loading babel or polyglossia with a language option redefines \today to follow that language's conventions. Month names and the order of day and month both change. This is useful for localized documents, but switching the language option also changes every \today in the file. Check the compiled output rather than assuming a particular format. The exact output for each language is defined by its language module, and this article does not list or verify those outputs.

Building a numeric date from TeX primitives

TeX exposes the compile date as three counters: \year, \month and \day. Printing them with \the gives bare numbers without leading zeros. To get a zero-padded, ISO 8601 style date (year-month-day) without loading any package, add the zero conditionally:

\the\year-\ifnum\month<10 0\fi\the\month-\ifnum\day<10 0\fi\the\day

Compiled on 31 October 2026, this prints 2026-10-31. Compiled on 5 March 2026, it prints 2026-03-05. Like \today, it reflects the compile date. It is a format change, not a way to fix the date.

The datetime2 package

When you need consistent formatting, or need to typeset a specific date rather than today's, the datetime2 package is the usual choice. It accepts dates in year-month-day form and renders them in the selected style. Its default style is ISO-like numeric output. Regional styles with month names are provided by separate language modules, and those modules must be installed for the regional options to work. The package documentation lists the available style and option names.

\usepackage{datetime2}
...
\DTMsetdatestyle{iso}
Signed on \DTMdate{2026-10-31}.   % fixed date, independent of compile day
Generated \DTMtoday.              % compile date in the current style

The practical benefit is separation. You store the date once in an unambiguous numeric form, then decide its appearance in one place. If you later change the style, every date written with \DTMdate updates consistently.

Which method fits which use

Method | Date shown | Changes on recompile? | Good fit
\today | Compile date, language-dependent format | Yes | Drafts, internal notes
\date{typed text} | Exactly what you typed | No | Final, signed or archived documents
Primitives (\year, \month, \day) | Compile date, any numeric layout you build | Yes | Package-free numeric stamps
datetime2 \DTMdate | Fixed date in a chosen style | No | Consistent formatting across a document
datetime2 \DTMtoday | Compile date in a chosen style | Yes | Styled build stamps

What the transformation actually changes

None of these methods alter characters in the way a reverse-text or Unicode font generator does. LaTeX date commands run at compile time and write ordinary characters into the output: digits, letters and punctuation. Your source file stores either the command (\today) or the literal date you typed. The PDF stores the resulting text, typeset in the document's normal font.

The distinction between source and output matters. A source file containing \today does not record a date at all; it records an instruction. Only the compiled PDF holds an actual date. If you keep only the source, the original date is lost the next time someone compiles it. TeX Live also supports overriding the compile date through environment variables (SOURCE_DATE_EPOCH together with FORCE_SOURCE_DATE) for reproducible builds. That is a build-system setting, not a document setting.

Calling a date "reversed" or "flipped" usually means reordering fields, for example changing month-day-year to day-month-year. That is a format choice handled by language settings or a date style. It is not character reversal or mirrored glyphs. If you need right-to-left document text, babel and polyglossia handle the bidirectional layout. Digit order within a date in those settings is governed by the language support, and you should check it in your own output.

Readability after copying and sharing

  • Copying from the PDF: because dates are output as ordinary characters, they generally copy as normal text. Formatting such as superscript ordinals (\textsuperscript{st}) is not carried over as text formatting. What a given viewer extracts was not tested for this article.
  • Spacing: a tie (~) between day and month, as in 31~October, prevents a line break inside the date. In the PDF it appears as a space. How it comes through on copy depends on the viewer.
  • Date ranges: typing -- produces an en dash (2026--2027). The en dash is a different character from a hyphen, which can matter if readers search or paste the range elsewhere.
  • Ambiguity: numeric dates like 10/31/2026 read naturally in the US but can be misread elsewhere, and a date such as 03/05/2026 is genuinely ambiguous. Spelling out the month, or using ISO year-month-day order, avoids misreading for mixed audiences.
  • Search: PDF search matches the text as typeset. Readers searching for "2026-10-31" will not find "October 31, 2026". Choose one format and use it throughout a document.

Accessibility depends mainly on the PDF as a whole, not on the date command. A screen reader can only read a date as well as the PDF exposes its text and structure. Whether a LaTeX-produced PDF is tagged is a separate workflow from date formatting. No screen reader or specific PDF viewer was tested for this article, so the observations above are general principles rather than verified results for any named tool. A spelled-out month is generally the least ambiguous form for listeners as well as readers. If the date must also appear in metadata, an email or a web page, keep a plain-text equivalent in a consistent format rather than relying on a copy from the PDF.

Gaps in this review

This overview relies on documented LaTeX and package behavior, not hands-on testing. It does not verify the exact \today output for each babel or polyglossia language, copy-paste results in particular PDF viewers, or screen reader handling of dates in tagged and untagged PDFs. If any of these matter for your document, compile a short test file and check the output in the destinations your readers actually use.