1

I wish to format today's date as october 2022. Emphasis on the lowercase october. I know that \today gives me October 24, 2022. How can I extract just the month and the year? I tried using \the\month \the\year but that gives me 10 2022. Is there a short command to convert numeric month to words?

I am also aware that I can use the datetime package to format dates. The following snippet from statatexblog.com kinda works. However, it gives me October 2022. I am unable to convert October to lowercase october. Neither \MakeLowercase nor \lowercase seems to work. Is there a workaround?

\documentclass[english,a4paper,oneside,12pt]{article} 
\usepackage{datetime}
\newdateformat{monthyeardate}{\monthname[\THEMONTH] \THEYEAR}
\begin{document} 
The current month is \MakeLowercase{\monthyeardate\today} 
\end{document}
1

1 Answer 1

1

Here, \lcmonth gives the lowercased month name. An optional argument of a number will give the lowercased month name associated with the number.

\documentclass[english,a4paper,oneside,12pt]{article} 
\newcommand\lcmonth[1][\the\month]{\ifcase#1
  \or
  january\or 
  february2\or
  march\or
  april\or
  may\or
  june\or
  july\or
  august\or
  september\or
  october\or
  november\or
  december\fi}
\begin{document} 
The current month is \lcmonth\ \the\year.

\lcmonth[6]
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .