3

I have found questions where \today has been edited – but in such a way which I do not want to have. Yet, I do not know how to programme it.

If I write \today, I do not want to see something like this:

December 2, 2017

I would like to see something like this:

2nd December 2017

Note that this date format should be able to distinguish between 1st, 2nd, 3rd, 4th, etc.

The package nth with \nth{} might be useful.

6

With datetime2 and datetime2-english:

\documentclass{article}
\usepackage[en-GB]{datetime2}
\DTMlangsetup[en-GB]{ord=raise}
\begin{document}
\today
\end{document}

2nd December 2017

  • Is there a french version like fr-FR somewhere? With overleaf.com, it doesn't exist. – pzorba75 Dec 2 '17 at 18:21
  • @pzorba75 The French version is provided with datetime2-french. I think there's just the regionless french support with that. – Nicola Talbot Dec 2 '17 at 19:51
6

The following does what you want

\documentclass[]{article}

\usepackage[super]{nth}

\month=2
\def\today{%
  \nth{\day}
  \ifcase\month
    \or January%
    \or February%
    \or March%
    \or April%
    \or May%
    \or June%
    \or July%
    \or August%
    \or September%
    \or October%
    \or November%
    \or December\fi
    \space
    \number \year
}
\begin{document}
\today
\end{document}

enter image description here

6

Here is an example, how to format the date according your needs. This snippet is adapted from this question.

\documentclass{article}
\usepackage[nodayofweek]{datetime}

\newdateformat{mydate}{\twodigit{\THEDAY}{ }[\THEMONTH], \THEYEAR}

\begin{document}

\today
\mydate

\end{document}

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.