Menu

HowTo_Letter_datetime

How to set the date for letters with the datetime package

When using package datetime together with scrlttr2 or scrletter, there are various incompatibilities in the definition of \today. It is therefore best to specify the date explicitly via \formatdate in this case. For the current date, this can be done using \day, \month and \year, for example:

\documentclass{scrlttr2}
\usepackage[english]{babel} 
\usepackage[dayofweek,long]{datetime}
\setkomavar{date}{\formatdate{\day}{\month}{\year}}

\begin{document}
\begin{letter}{You\\There}
\opening{Dear Sir or Madam,}
\closing{Yours faithfully}
\end{letter}
\end{document}

to output the date in an English letter with a superscript day, for example "Tuesday 3rd June, 2025".

Apart from this, it should be noted that the datetime package is now officially considered obsolete and should no longer be used. More details can be found under the package link.


Related

Wiki (English): HowTo_Letter

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.