From 44402ae1a3d0b393376e662cefea512c052b1650 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 23 Dec 2016 11:30:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BModel=E7=B1=BBwriteTransform?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index f917adf2..fb2f5abf 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -397,9 +397,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess break; case 'datetime': $format = !empty($param) ? $param : $this->dateFormat; - if (false === strpos($format, '\\')) { - $value = date($format, is_numeric($value) ? $value : strtotime($value)); - } + $value = is_numeric($value) ? $value : strtotime($value); + $value = $this->formatDateTime($value, $format); break; case 'object': if (is_object($value)) {