The attached patch improves the Mdocdate code and updates the documentation to match. - in a2time(): Skip past "$Mdocdate: " if it exists instead of relying on the caller to specify it in the format string. Accept trailing text after a successful match (e.g. "$"). If the first character after a successful match is 'Z', use UTC instead of the local time zone. - in time2a(): Use a sufficiently large stack buffer and mandoc_strdup() instead of trying to guess at the correct length. - in mandoc_normdate(): Fix several logic errors (inverted tests), add a test for the Subversion %d format, and simplify the code. - in the man page: Document how to use Mdocdate with Subversion. Given the following test cases: % cat tests February 7 2036 February 7 2036 February 07 2036 February 7, 2036 February 7, 2036 February 07, 2036 Feb 7 2036 Feb 7 2036 Feb 07 2036 Feb 7, 2036 Feb 7, 2036 Feb 07, 2036 2036-02-07 2036-02-7 2036-2-07 2036-2-7 $Mdocdate: February 7 2036 $ $Mdocdate: 2036-02-07 06:28:16Z $ The current code (1.13.3) produces the following output: % while read d ; do echo ".Dd $d" | mandoc | tail -1 ; done