As datetime is superseded by datetime2, I'm struggling hard to achieve the following using the new package:

In an English document, I would like to show the current date (\today) once like this 20th December 2017 and once like this 2017-12-20.

According to the documentation, I get it right only one way globally for the whole document. I didn't find a simple example showing me how to get this done.

The answer given at https://tex.stackexchange.com/a/250057 fiddles with \@dtm@month etc. Is it that hard? It should be simple 🙄


2 Answers 2


You don't need to define a new format. You can use one of the regional English day-month formats, such as en-GB, for the textual date and iso for the numeric ISO-style date:




\today. \DTMsetstyle{iso}\today.


Requires that both datetime2 and datetime2-english are installed.

20th December 2017. 2017-12-20.


In sake of coming up with a short example, I solved it myself:



\renewcommand{\DTMdisplaydate}[4]{\DTMenglishordinal{##3}\ \DTMenglishmonthname{##2}\ \number##1}%


Though it is not as short as Nicola Talbot's answer 😕


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .