13

I use the \today comment, then it produces 26th February. However in my context, I want 26ten Februar. How can I change that?

6
  • 6
    Actually »babel« with its language option ngerman should already do the trick. But you can also have a look at »isodate«. For more than these assumptions you should provide a self-contained and minimal example. Feb 26, 2014 at 16:56
  • seems \usepackage[ngerman]{babel} does not work for me.
    – Ginger
    Feb 26, 2014 at 16:58
  • @Ginger You should post a minimal working example (MWE), so people can determine what is not working for you...
    – jub0bs
    Feb 26, 2014 at 17:30
  • 12
    The question was already answered, but as a native German speaker I have to say, that it is really unusual to write '26ten' or anything which resembles that. It should be written '26. Februar'.
    – user31729
    Feb 26, 2014 at 17:44
  • 1
    It seems that you didn't even bother to provide a minimal example (→ -1) Feb 27, 2014 at 15:52

1 Answer 1

19

Try with the datetime package, by defining a new date format:

\newdateformat{myformat}{\THEDAY{ten }\monthname[\THEMONTH], \THEYEAR}

MWE:

\documentclass{article}

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

\newdateformat{myformat}{\THEDAY{ten }\monthname[\THEMONTH], \THEYEAR}

\begin{document}

\myformat\today

\end{document} 

Output:

enter image description here


EDIT

If you can't load babel with the language ngerman, you can however load datetime as

\usepackage[ngerman]{datetime}

and define the date format as

\newdateformat{myformat}{\THEDAY{ten }\monthnamengerman[\THEMONTH], \THEYEAR}

MWE:

\documentclass{article}

\usepackage[english]{babel}
\usepackage[ngerman]{datetime}

\newdateformat{myformat}{\THEDAY{ten }\monthnamengerman[\THEMONTH], \THEYEAR}

\begin{document}

\myformat\today

\end{document} 

Output:

enter image description here

4
  • thanks@karlkoeller, but because i already have \usepackage[english]{babel}, then i cannot add \usepackage[ngerman]{babel}. If I do this\PassOptionsToPackage{english,ngerman}{babel}, Februry is still in English.
    – Ginger
    Feb 26, 2014 at 20:37
  • @Ginger Instead of \PassOptionToPackage, use \selectlanguage{ngerman} immediately after \begin{document} -
    – Sveinung
    Feb 26, 2014 at 23:21
  • @Ginger See the edited answer. Feb 27, 2014 at 6:15
  • 6
    @Ginger: Although this seems to answer the question, this is formally completely wrong (as already mentioned in the comments to the questions). In German we don't write dates in this way. Mark my words! Feb 27, 2014 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.