2

How can I apply localization for the \date command? For now it seems to just display an arbitrary string.

\documentclass{article}

\author{me}
\date{bla bla bla}

\begin{document}
\maketitle
\end{document}

How can I specify a date in some format? I used datetime2 \date{\DTMdate{2020}{9}{7}} but it gives me compilation error: Paragraph ended before \@dtm@parsedate was complete.

1 Answer 1

4

It helps to read the documentation

You would write instead

\date{\DTMdate{2020-9-7}}

You will, of course need to load the datetime2 package with

\usepackage[useregional]{datetime2}

and use the appropriate babel options to select your language.

2
  • It does not seem to reflect my babel/polyglossia configuration. Furthermore, 2020-40-40 also works, which is weird. Commented Sep 14, 2020 at 5:03
  • 1
    It doesn't seem to really have any validation in it. There is a limited set of languages which are supported by datetime2. You can look at an existing .ldf file for a model of how to add in a missing language.
    – Don Hosek
    Commented Sep 14, 2020 at 16:10

You must log in to answer this question.

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