I am using the titling package the resuse the defined date etc. using a plain \thedate
command. However the date format is not what I need because of different type of localization.
My first shot was using isodate package using an appropriate option but this seems not to work with the titling package.
Anyway, here is what I created:
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[ngerman]{isodate}
\usepackage{titling}
\setlength{\parindent}{0pt}
\date{\today}
\begin{document}
typically this: \thedate \\
should be: \today \\
but it is: {\origdate\thedate} \\
not even: {\isodate\thedate} \\
\end{document}
Clearification: My intention is to reuse the defined date using \date
with any apropriate tool. I came up using titling which works great for titles etc. but the date show formatting issues (\today
and \thedate
differ). Following a comment I tried to use the datetime2 package, which does not seem to work using the date reference solution I use so far.
Here is a snippet using datetime2 package:
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[useregional]{datetime2}
\usepackage{titling}
\setlength{\parindent}{0pt}
\date{\today}
%\DTMsavedate{date0}{\thedate} % does not compile
\DTMsavedate{date1}{2017-04-25}
\begin{document}
\selectlanguage{ngerman}
%maybe this: \DTMdate{\thedate} \\ % neither does this
wait, what: \DTMusedate{date1} \\
\end{document}
\date
and apply an appropriate format which does not work using the datetime2 package. I tried using\DTMdate{\thedate}
and\DTMsavedate{date}{\thedate}
but neither did work with the date reference. I might come up storing the date by hand as an solution though.german date: \DTMusedate{date1}\\ \selectlanguage{british} british date: \DTMusedate{date1}\\ \selectlanguage{french} french date: \DTMusedate{date1}
(seems ok for me, using:\usepackage[ngerman,british,french]{babel}
of course)\today
command (for simplicity). I had it working too, please see the question edit for further information.