From: Michael Date: Wed, 4 Apr 2018 18:58:25 +0000 (+0000) Subject: Avoid "Failed to parse time string (-001-11-30T00:00:00+00:00 + 32 days)" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=211ba75b22ce3b9b6cdcf76ac949906160c16999;p=friendica.git Avoid "Failed to parse time string (-001-11-30T00:00:00+00:00 + 32 days)" --- diff --git a/src/Util/DateTimeFormat.php b/src/Util/DateTimeFormat.php index 31876d742b..e293857acd 100644 --- a/src/Util/DateTimeFormat.php +++ b/src/Util/DateTimeFormat.php @@ -109,6 +109,9 @@ class DateTimeFormat * months and days always start with 1. */ if (substr($s, 0, 10) <= '0001-01-01') { + if ($s < '0000-00-00') { + $s = '0000-00-00'; + } $d = new DateTime($s . ' + 32 days', new DateTimeZone('UTC')); return str_replace('1', '0', $d->format($format)); }