I like to print dates formatted in this way: 6 October 2018. Usually, I just type the date by hand. But I tried to set things up so that \today would format dates the way I like. I must have only tested it when the day number was two digits. I have this:
\documentclass{article}
\usepackage[english]{datetime2}
\DTMnewdatestyle{strunkdate}{%
\renewcommand*{\DTMdisplaydate}[4]{##3 \DTMenglishmonthname{##2} ##1}
\renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}}
\AtBeginDocument{%
\DTMsetdatestyle{strunkdate}}% after babel loaded, or babel stomps on this
\begin{document}
Today is \today.
\end{document}
Unfortunately, this prints 06 October 2018, with a leading zero to force a two-digit day. How do I get 6 October 2018, without the leading zero?
datetime2, page 95. No caveat about the problem of following space, unfortunately. – egreg Oct 06 '18 at 19:48\number\numexpr##3\relax\space\DTMenglishmonthname{##2} ##1could be better. – egreg Oct 06 '18 at 20:04\looks nicer in the code and doesn't require an essay on what it does:-) – David Carlisle Oct 06 '18 at 20:09