datetime2 doesn't expand months in \DTMDisplaydate

I want to use strings for dates in my document that can be formatted either as ISO or German later on.

I looked at isodate datetime and datetime2 most promising seemed to be the latest, but the months don't show up in German.

However in a document

\usepackage{datetime2}
\DTMsetstyle{german}
\today
\DTMDisplaydate{2017}{3}{8}{-1}


\today is expanded correctly as 8. März 2017, but \DTMDisplaydate{2017}{3}{8}{-1} results in 8. 3 2017 which is not correct, it should either be heute 8. 3. 2017 or 8. März 2017

Based on the expected output, just use \DTMdisplaydate rather than \DTMDisplaydate:

9. März 2017
8. März 2017

\documentclass{article}

\usepackage{datetime2}
\DTMsetstyle{german}

\begin{document}

\today

\DTMdisplaydate{2017}{3}{8}{-1}

\end{document}


For datetime2-german, \DTMDisplaydate should be the same as \DTMdisplaydate, but I made an error (mostly probably from copy and pasting from another language file that has lower case months). The simplest method is to use Werner's solution (just use \DTMdisplaydate). If you need \DTMDisplaydate (for example, you may be switching languages), then either wait for version 1.1 2017-03-09 (which I've just uploaded) or redefine the style:

\documentclass{article}

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

\DTMrenewdatestyle
{german}%
{%
\renewcommand*\DTMdisplaydate[4]{%
\DTMifbool{german}{showdayofmonth}%
{\DTMgermanordinal{##3}\DTMgermandaymonthsep}%
{}%
\DTMgermanmonthname{##2}%
\DTMifbool{german}{showyear}%
{%
\DTMgermanmonthyearsep
\number##1 % space intended
}%
{}%
}%
\renewcommand{\DTMDisplaydate}{\DTMdisplaydate}%
}

\begin{document}

\today.
\DTMDisplaydate{2017}{3}{8}{-1}

\end{document}