Index: subversion/libsvn_subr/date.c
===================================================================
--- subversion/libsvn_subr/date.c	(revision 15255)
+++ subversion/libsvn_subr/date.c	(working copy)
@@ -203,14 +203,20 @@
   if (apr_err != APR_SUCCESS)
     return svn_error_wrap_apr (apr_err, _("Can't manipulate current date"));
 
+  /* I am not sure why the [] SKIPFROM operators were not used in the
+   * date templates which have seperators for the date.  Obviously those
+   * date formats that do not have seperators cannot use [] as it would
+   * not be known if the month, day or both was omitted.
+   */
+
   if (template_match (&expt, &localtz, /* ISO-8601 extended, date only */
-                      "YYYY-MM-DD",
+                      "YYYY-M[M]-D[D]",
                       text)
       || template_match (&expt, &localtz, /* ISO-8601 extended, UTC */
-                      "YYYY-MM-DDThh:mm[:ss[.u[u[u[u[u[u][Z]",
+                      "YYYY-M[M]-D[D]Thh:mm[:ss[.u[u[u[u[u[u][Z]",
                       text)
       || template_match (&expt, &localtz, /* ISO-8601 extended, with offset */
-                         "YYYY-MM-DDThh:mm[:ss[.u[u[u[u[u[u]+OO[:oo]",
+                         "YYYY-M[M]-D[D]Thh:mm[:ss[.u[u[u[u[u[u]+OO[:oo]",
                          text)
       || template_match (&expt, &localtz, /* ISO-8601 basic, date only */
                          "YYYYMMDD",
@@ -222,10 +228,10 @@
                          "YYYYMMDDThhmm[ss[.u[u[u[u[u[u]+OO[oo]",
                          text)
       || template_match (&expt, &localtz, /* "svn log" format */
-                         "YYYY-MM-DD hh:mm[:ss[.u[u[u[u[u[u][ +OO[oo]",
+                         "YYYY-M[M]-D[D] hh:mm[:ss[.u[u[u[u[u[u][ +OO[oo]",
                          text)
       || template_match (&expt, &localtz, /* GNU date's iso-8601 */
-                         "YYYY-MM-DDThh:mm[:ss[.u[u[u[u[u[u]+OO[oo]",
+                         "YYYY-M[M]-D[D]Thh:mm[:ss[.u[u[u[u[u[u]+OO[oo]",
                          text))
     {
       expt.tm_year -= 1900;
@@ -245,6 +251,7 @@
   /* Range validation, allowing for leap seconds */
   if (expt.tm_mon < 0 || expt.tm_mon > 11
       || expt.tm_mday > valid_days_by_month[expt.tm_mon]
+      || expt.tm_mday <= 0
       || expt.tm_hour > 23
       || expt.tm_min > 59
       || expt.tm_sec > 60)
