From 37b74f674e531ba16e36f36f521409845f9625d3 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 21 Apr 2017 21:46:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E8=87=AA=E5=8A=A8=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E9=97=B4=E5=86=99=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index fd8c7124..71186b91 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -380,12 +380,12 @@ abstract class Model implements \JsonSerializable, \ArrayAccess case 'datetime': case 'date': $format = !empty($param) ? $param : $this->dateFormat; - $value = $this->formatDateTime($_SERVER['REQUEST_TIME'], $format); + $value = $this->formatDateTime(time(), $format); break; case 'timestamp': case 'integer': default: - $value = $_SERVER['REQUEST_TIME']; + $value = time(); break; } } elseif (is_string($this->autoWriteTimestamp) && in_array(strtolower($this->autoWriteTimestamp), [ @@ -394,9 +394,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess 'timestamp', ]) ) { - $value = $this->formatDateTime($_SERVER['REQUEST_TIME'], $this->dateFormat); + $value = $this->formatDateTime(time(), $this->dateFormat); } else { - $value = $this->formatDateTime($_SERVER['REQUEST_TIME'], $this->dateFormat, true); + $value = $this->formatDateTime(time(), $this->dateFormat, true); } return $value; }