diff --git a/SystemTools.cxx b/SystemTools.cxx
index 1899df418f2a42a9a6f3ad44e12a882711466129..eb1aadf0c7699abc1d98699b1b02f5e48fc0c11c 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -1764,7 +1764,7 @@ long int SystemTools::CreationTime(const char* filename)
 
 bool SystemTools::ConvertDateMacroString(const char *str, time_t *tmt)
 {
-  if (!str || !tmt || strlen(str) < 12)
+  if (!str || !tmt || strlen(str) > 11)
     {
     return false;
     }
@@ -1812,7 +1812,7 @@ bool SystemTools::ConvertDateMacroString(const char *str, time_t *tmt)
 
 bool SystemTools::ConvertTimeStampMacroString(const char *str, time_t *tmt)
 {
-  if (!str || !tmt || strlen(str) < 27)
+  if (!str || !tmt || strlen(str) > 26)
     {
     return false;
     }