diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php
index 5b3c18c972047d6873a82c09671819db6699bd02..cac6e8ac52bbe6242dadc54c88b7cdc4d8844649 100644
--- a/apps/dav/lib/Files/FileSearchBackend.php
+++ b/apps/dav/lib/Files/FileSearchBackend.php
@@ -352,7 +352,7 @@ class FileSearchBackend implements ISearchBackend {
 				return 0 + $value;
 			case SearchPropertyDefinition::DATATYPE_DATETIME:
 				if (is_numeric($value)) {
-					return 0 + $value;
+					return max(0, 0 + $value);
 				}
 				$date = \DateTime::createFromFormat(\DateTime::ATOM, $value);
 				return ($date instanceof \DateTime) ? $date->getTimestamp() : 0;