datetime2

Today's date and the time, in the document's own style; a date written out from its parts, and one kept under a name to be used again.

Loading

\usepackage{datetime2}

A module of its own, compiled into mLaTeX: the package's commands are defined over mLaTeX's primitives.

Commands

\DTMcurrenttime, \DTMdate, \DTMdisplaydate, \DTMfetchyear, \DTMlangsetup, \DTMnow, \DTMsavedate, \DTMsavenow, \DTMsetdatestyle, \DTMsetstyle, \DTMsettimestyle, \DTMtoday, \DTMusedate.

Example

A document that uses it, from mLaTeX's own tests, so it compiles as written, and below it what mLaTeX sets from it in your browser:

datetime2.tex
\documentclass{article}
\usepackage[en-GB]{datetime2}
\begin{document}
Today is \DTMtoday; now is \DTMnow; a date \DTMdate{2026-09-29}.
\end{document}
OutputLoading mLaTeX in your browser
Loading mLaTeX