2

Using the datetime2 package, how do I tell \today to display the date in the format: 'Fri, March 1, 2019'?

\documentclass{article}
\usepackage{datetime2}
\begin{document}
\today
\end{document}
noibe
  • 2,084

1 Answers1

3

Below I define a new date style called mydateformat, and then use it with \DTMsetdatestyle{mydateformat}.

resulting date format

\documentclass{article}

\usepackage[calc,showdow,english]{datetime2}

\DTMnewdatestyle{mydateformat}{% \renewcommand{\DTMdisplaydate}[4]{% \DTMshortweekdayname{##4},\space% short weekday, \DTMmonthname{##2}\nobreakspace% (full) Month \number##3,\space% day, \number##1% year }% \renewcommand{\DTMDisplaydate}{\DTMdisplaydate}% }

\begin{document}

\today

\DTMsetdatestyle{mydateformat}

\today

\end{document}

Socob
  • 1,693
Werner
  • 603,163
  • Dear Professor, could you please help me in this question: https://tex.stackexchange.com/questions/478218/changing-the-date I want that the letter t will be separated a bit from the number 7. Thanks a lot. – Schüler Mar 09 '19 at 13:31
  • @Schüler: See my answer that uses datetime2 and introduces a small space \, before the ordinal day/number. – Werner Mar 09 '19 at 17:27