redefine date format in letter environment

Haines Brown haines at histomat.net
Wed Dec 7 14:30:29 CET 2022


I want today's date to appear: 2022.21.07 rather than 2022.21.7

\documentclass[letterpaper,12pt]{letter}

\usepackage{fontspec}
\usepackage{libertinus-otf}

\def\mydate{\leavevmode\hbox{\the\year.\twodigits\month.\twodigits\day}}
\def\twodigits#1{\ifnum#1<10 0\fi\the#1}
\renewcommand*\today{\number\year.\number\month.\number\day}

\begin{document}
\begin{letter}{}

  \opening{}

\end{letter}
\end{document}


-- 

     Haines Brown 
 /"\
 \ /  ASCII Ribbon Campaign
  X    against HTML e-mail 
 / \



More information about the texhax mailing list.