diff --git a/include/simpleplugin/class_attribute.inc b/include/simpleplugin/class_attribute.inc
index ce22c83986dd735fdc4ce5f23a6f8cfcd5dc40e5..8836f0f52ef9e1ee5f13b1535e5d92c7b8336b09 100644
--- a/include/simpleplugin/class_attribute.inc
+++ b/include/simpleplugin/class_attribute.inc
@@ -1513,7 +1513,11 @@ class DateAttribute extends Attribute
         try {
           $this->getDateValue();
         } catch (Exception $e) {
-          return _("Error, incorrect date: ").$e->getMessage();
+          if (is_object($this->plugin) && $this->plugin->is_template) {
+            return;
+          } else {
+            return sprintf(_('Error, incorrect date: %s'), $e->getMessage());
+          }
         }
       }
     }
diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc
index 3e78d40e8e4159754f15323adffea5a194e8ea36..e5dd5a894cccad90266070d23a821cb335a0fe8a 100644
--- a/plugins/personal/posix/class_posixAccount.inc
+++ b/plugins/personal/posix/class_posixAccount.inc
@@ -60,7 +60,15 @@ class EpochDaysDateAttribute extends DateAttribute
     if (empty($this->value)) {
       return 0;
     } else {
-      return $this->dateToLdap($this->getDateValue());
+      try {
+        return $this->dateToLdap($this->getDateValue());
+      } catch (Exception $e) {
+        if (is_object($this->plugin) && $this->plugin->is_template) {
+          return $this->value;
+        } else {
+          throw $e;
+        }
+      }
     }
   }
 }