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}
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityUsing 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}
Below I define a new date style called mydateformat
, and then use it with \DTMusedatestyle{mydateformat}
.
\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}