I want \date{2015-10-10} to print 10th October, 2015 or similar. I don't want to separate the date value from the place where it is inserted into the document.


Along the same lines as the other answer (save it and immediately print it in a macro), but using datetime2 for formatting:




October 10, 2015

January 1, 2015


The \date command does not print the date, it stores its argument on the \@date macro. Macros with @, to be used must be enclosed within \makeatletter and \makeatother. Knowing this you can make a command which takes an argument, pass it to \date and prints it afterwards:


Some text \printdate{2015-12-12} \printdate{2014-12-12}

Note that this is an overall solution and depending on the packages you are using could not give the expected results.

  • But I believe that would print the date as given, not convert it to "December 12th, 2015". Yes? – Teepeemm Oct 21 '16 at 14:08
  • I'm not sure if that would happen always. In this case yes as there's no packages involved. – Guilherme Zanotelli Oct 21 '16 at 14:13

Under the british language setting for datetime2, you can set your date style using \DTMdisplaydate{YYYY}{MM}{DD}{DoW} or \DTMdate{YYYY-MM-DD}:

enter image description here



  % #1 = year
  % #2 = month
  % #3 = day
  % #4 = day of week
    \DTMordinal{##3} \DTMenglishmonthname{##2}, \number##1}%


\today% ...or \DTMtoday

% \DTMdisplaydate{YYYY}{MM}{DD}{DOW}

% \DTMdate{YYYY-MM-DD}

\DTMsetdatestyle{mydate}% Set new date style


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.