I’m using svn-multi to include the date of the most recent Subversion commit of my documents. However, the string has the format 2013-10-13 11:05:51 +0200 (Sun, 13 Oct 2013). Is it possible to convert this string to the same date format that is used by \today?

Here is a minimal working example (Subversion inserts the date automatically before a commit):


{$LastChangedBy: mcb $}
{$LastChangedRevision: 23 $}
{$LastChangedDate: 2013-10-13 11:05:51 +0200 (Sun, 13 Oct 2013) $}
{$HeadURL: http://example.org $}

\title{Sample Document}



  • 3
    Can you add a minimal working example (MWE)? – egreg Oct 13 '13 at 10:06
  • I suggest you to follow this nice tutorial here There was also an equivalent question on tex.stackexchange here, and here for the parsing, that might help you. Should you have any further problem, please do not hesitate let us know. A Mininum Working Example ([MWE](meta.tex.stackexchange.com/questions/228/… – Header12 Oct 13 '13 at 10:08
  • pgf/tikz has a date library which can parse dates. It cannot parse times, though. The parsed date can be reformatted as needed. – Christian Feuersänger Oct 13 '13 at 11:08

Here's how to parse the date. The other answer gives links on adjusting the display:



\def\parsecommitdate#1-#2-#3 #4:#5:#6 #7\endparse{%

\newcommand{\svndate}{2013-10-13 11:05:51 +0200 (Sun, 13 Oct 2013)}

\title{Sample Document}


% Since \svndate is not available in the preamble the date must be set in the document environment.


  • This works really well, thank you. However, it does not work together with the \svndate (which just prints the date string). The error message is: Paragraph ended before \parsecommitdate was complete. – Lenar Hoyt Oct 13 '13 at 10:37
  • 1
    @mcb You need to expand \svndate before it can be parsed. It \svndate is a one level expansion of the formatted date you can just put \expandafter before \parsecommitdate. – Nicola Talbot Oct 13 '13 at 10:43
  • It doesn’t seem to work with the MWE above. – Lenar Hoyt Oct 13 '13 at 11:13
  • @mcb It compiles fine for me. In what way does it not work for you? (Does it give an error message or produce unexpected output?) – Nicola Talbot Oct 13 '13 at 12:14
  • @NicolaTablot Still the same error: Paragraph ended before \parsecommitdate was complete. (I just copied my MWE from above and added package, definition from your answer and replaced the line with the date.) – Lenar Hoyt Oct 13 '13 at 12:23

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.