Is there an easy way to print out dates in the format of 2014-Jan-15. Being in North America, Canada not the USA, there are too many date formats in use. To remove any chance of confusion the client would like to use YYYY-MMM-DD.

I can do my program creating the latex PDF is running on debin Linux and not Windows.

  • 1
    What kind of data do you have? And check out the datetime package. Jan 21, 2015 at 17:58
  • 2
    If you want to avoid confusion, you should use the standard format YYYY-MM-DD; see the answer by Uwe. Jan 22, 2015 at 1:28

3 Answers 3


Use the datetime package:




  Date #1-#2-#3 formats as \FormatDate{#1}{#2}{#3}.\par}

Today is {\gregdate\today}.


If you wish to rename months, you can redefine \shormonthnameenglish to suit your needs. (You can patch other macros as used by babel, if necessary; see dt-austrian.def, for example.)

  \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month
  numbers should go from 1 (jan) to 12 (dec)}%
  \or Jan%
  \or Feb%
  \or Mar%
  \or Apr%
  \or May%
  \or Jun%
  \or Jul%
  \or Aug%
  \or Sept%
  \or Oct%
  \or Nov%
  \or Dec%
  {Invalid Month number \the\@orgargctr}%
  {Month numbers should go from 1 (jan) to 12 (dec)}%
  • 1
    You would have to ask OP. I imagine you can change it. I've added a way to patch. Jan 21, 2015 at 19:37

Have a look at the isodate package:



\isodate \today




Taking a look at article.cls you find the definition of the macro \today. You could re-define that macro to suit your tastes and even define a new macro (e.g., \mydate) to print in the style you asked the date inserted in the usual format.

  Jan\or Feb\or Mar\or Apr\or May\or Jun\or%
  Jul\or Aug\or Sep\or Oct\or Nov\or Dec\fi%
  Jan\or Feb\or Mar\or Apr\or May\or Jun\or%
  Jul\or Aug\or Sep\or Oct\or Nov\or Dec\fi%
\today{} vs. \mydate{2015}{01}{21}

output of code

  • Back at this one. Have looked at all the suggestions, very good for all but they are all talking about printing the '\today' date. What I am printing is a variable with a date in it: ie: <shipdate> I am getting totally mixed up how to just change the month part from 05 or MAY. As the great man said, if you think the solution is simple, then obviously you do not understand the total problem. May 6, 2015 at 15:53
  • @GregoryWest: I didn't really understand your comment above, sorry. If it meant that your problem is solved, please consider upvoting this answer and/or marking it as “accepted”. If your problem is still not solved, please rephrase your original question adding a clear example of what you have and what you would like to get.
    – Pier Paolo
    May 6, 2015 at 17:13
  • No still have the problem. Here is what I am trying to solve. I have a latex report form being called from a program which also passes a lot of data down to the form. There are about 8 different dates involved. Right now the dates are printing in the form of 2015-05-07 but the client wants them to print in the form 2015-MAY-07. What I was hoping for (I can dream can't I) a function like \alphadate{<%deliverydate%>} which would also work on \alphadate{<%duedate%>} \alphadate{<%shipdate%>} etc. Does this make any more sense? May 7, 2015 at 18:31
  • @GregoryWest: It is still not clear enough to me. (A suggestion: If you edit your original question, this post will be put back to the main page of the site where many more users will read it (and possibly answer it), while right now it's just me that still follows this post.)
    – Pier Paolo
    May 7, 2015 at 19:16
  • Here is one of the lines of Latex code printing a date: May 7, 2015 at 22:07

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.