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.

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.

  • It does not seem to reflect my babel/polyglossia configuration. Furthermore, 2020-40-40 also works, which is weird. – Minh Nghĩa Sep 14 '20 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 Sep 14 '20 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.