TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}



share|improve this question
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
up vote 12 down vote accepted

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.


share|improve this answer
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
@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 posting your answer, you agree to the privacy policy and terms of service.

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