Date Formatting in LaTeX (LaTeX: Tips/Solution-28)

Опубликовано: 16 Июль 2026
на канале: Chandra Has
4,355
41

Different ways to print the date in the scientific document using LaTeX.

-===============Code=======================
\documentclass[12pt]{article}
\usepackage{datetime}
%\renewcommand{\dateseparator}{-}
%Options:
%yyyymmdd, ddmmyyyy, dmyyyy, ddmmyy, dmyy, mmddyyyy, mdyyyy, mmddyy, mdyy,
%nodayofweek, long, short

%\newdateformat{mydate}{\THEDAY-\THEMONTH-\THEYEAR}
%\newdateformat{mydate}{\twodigit{\THEDAY}-\THEMONTH-\THEYEAR}
\newdateformat{mydate}{\shortmonthname~\ordinal{DAY}, \THEYEAR}

\title{Date Formatting in \LaTeX}
\author{Chandra Has\\ \small [email protected]}

%\date{}
%\date{\today}
%\date{09-10-2018}
\date{\mydate\today}

\begin{document}
\maketitle

The date is displayed as \mydate\today.

\end{document}

-----------------------------------------------------------------------
Sample file:
-----------------------------------------------------------------------

If this worked and helped you
► Do not forget to Like, Comment, and Subscribe!

=================================================
► To Watch all our videos, click here - https://goo.gl/aCCrzi
► Subscribe to our channel, click here - https://goo.gl/9QCQhC