# Formatting datetime2 in LaTex to 4th September, 2016 without the current day?

I'm currently using

\usepackage[UKenglish]{babel}
\usepackage{datetime}


and I'm getting Sunday 4th September, 2016

with the commands \today or with \newdate{example}{01}{09}{2016} (outside of \begin{document}) and \displaydate{example} inside the document.

How can I reformat this date to not have the name of the day in it (Best would be with using datetime2)? So like 4th September, 2016. With the "th" as a high letter like this:

Full document example:

\documentclass[a4paper, 12pt, DIV=calc, headings=small]{scrreprt}
%Used packages
\usepackage[UKenglish]{babel}
\usepackage[utf8]{luainputenc}
\usepackage{datetime}

%Other definitions
\pagenumbering{arabic}

\newdate{sample}{31}{01}{2017}

\begin{document}
\displaydate{sample}\\
\today
\end{document}

• Welcome to TeX.SX. Please post a compilable document, since we don't know which command was used by you to show the date at all.
– user31729
Sep 4 '16 at 16:24
• It is a fragment only, so far. Please post a document, not just macro calls
– user31729
Sep 4 '16 at 16:31

Since you asked for a datetime2 solution:

\documentclass{article}

\usepackage[UKenglish]{babel}
\usepackage[useregional]{datetime2}

\DTMlangsetup[en-GB]{ord=raise,monthyearsep={,\space}}

\DTMsavedate{sample}{2017-01-31}

\begin{document}
\DTMusedate{sample}

\today

\end{document}


Produces

Requires datetime2 (base code) and datetime2-english (for en-GB style).

The name of day is defined with the macro \dayofweekname, you can simply deactivate it with \renewcommand{\dayofweekname}[3]{\relax}

Code

\documentclass[a4paper, 12pt, DIV=calc, headings=small]{scrreprt}
%Used packages
\usepackage[UKenglish]{babel}
\usepackage[utf8]{luainputenc}
\usepackage{datetime}
%Other definitions
\pagenumbering{arabic}

\newdate{sample}{31}{01}{2017}

\renewcommand{\dayofweekname}[3]{\relax}

\begin{document}
\displaydate{sample}\\
\today
\end{document}


Output

• It's simpler to just use the nodayofweek package option. Sep 4 '16 at 17:06