[Tex/LaTex] Date formatting: Changing from web format to another format

datetimeformatting

I have two different dates in my LaTeX document which are not current dates (dates which come in my LaTeX template from the web form).
They look like this: 2016-03-31, but I want these dates be in the format dd/mm/yyyy.
What I'm doing right now is using the package \usepackage[ddmmyyyy]{date time}
and put inside the \date{} in my dates, but it doesn't change the format of the dates. How do I change the format of the dates correctly?

Best Answer

This works out the box. If - appears as the date separator there's probably a 'wrong'redefinition of \dateseparator.

Please note date datetime isn't developed further -- Nicola Talbot has published datetime2 about a year ago.

\documentclass{article}

\usepackage[ddmmyyyy]{datetime}
%\renewcommand{\dateseparator}{-}

\title{The Theory of Brontosaurs}
\author{Mrs. Ann Elk}
\date{\today}

\begin{document}
\maketitle
\end{document}

enter image description here

Update

Here's a version that transforms yyyy-mm-dd input into dd/mm/yyyy:

\documentclass{article}

\usepackage{xparse}

\ExplSyntaxOn
\newcommand{\changedate}[2][/]{%
  \tl_set:Nx \l_tmpa_tl {#2}
  \seq_set_split:NnV \l_tmpa_seq {-} {\l_tmpa_tl}
  \seq_reverse:N \l_tmpa_seq
  \seq_use:Nnnn \l_tmpa_seq {#1} {#1} {#1}
}
\ExplSyntaxOff

\title{The Theory of Brontosaurs}
\author{Mrs. Ann Elk}

\newcommand{\webdate}{2016-03-31}

\date{\changedate{\webdate}}


\begin{document}
%\changedate{\webdate}
\maketitle
\end{document}

enter image description here

Related Question