diff --git a/library/think/Model.php b/library/think/Model.php index 7a488c95..61baa3a7 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -350,7 +350,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess { if (false !== strpos($format, '\\')) { $time = new $format($time); - } elseif (!$timestamp) { + } elseif (!$timestamp && false !== $format) { $time = date($format, $time); } return $time;