diff --git a/src/view/form/control/AphrontFormDateControlValue.php b/src/view/form/control/AphrontFormDateControlValue.php --- a/src/view/form/control/AphrontFormDateControlValue.php +++ b/src/view/form/control/AphrontFormDateControlValue.php @@ -97,7 +97,8 @@ return $value; } - $readable = $value->formatTime($epoch, 'Y!m!d!g:i A'); + $dt = new DateTime("@$epoch"); + $readable = $dt->format('Y!m!d!g:i A'); $readable = explode('!', $readable, 4); $year = $readable[0]; diff --git a/src/view/viewutils.php b/src/view/viewutils.php --- a/src/view/viewutils.php +++ b/src/view/viewutils.php @@ -132,8 +132,8 @@ try { $date = new DateTime('@'.$epoch); } catch (Exception $ex) { - // NOTE: DateTime throws an empty exception if the format is invalid, - // just replace it with a useful one. + // NOTE: Before PHP 8.3, DateTime throws an empty exception if the format + // is invalid, just replace it with a useful one. throw new Exception( pht("Construction of a DateTime() with epoch '%s' ". "raised an exception.", $epoch));