Anyone know how to format \today
to DD-MMM-YYYY format? (Example 01-JAN-2017).
Note that it is important that the month is in capital letters.
I've tried some available packages, but so far haven't been able to find a solution that works.
Anyone?
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 communityAnyone know how to format \today
to DD-MMM-YYYY format? (Example 01-JAN-2017).
Note that it is important that the month is in capital letters.
I've tried some available packages, but so far haven't been able to find a solution that works.
Anyone?
The below example fulfill your requirement:
\documentclass{article}
\makeatletter
\def\today{%
\two@digits{\the\day}-%
\ifcase\month\or%
JAN\or FEB\or MAR\or APR\or MAY\or JUN\or%
JUL\or AUG\or SEP\or OCT\or NOV\or DEC\fi-%
\number\year%
}
\makeatother
\begin{document}
\today
\end{document}
Hope this helps.
Output:
12-JUL-2017