From 60fdcae8e517ab8bcbccd0fd95db9ff2fdddc38f Mon Sep 17 00:00:00 2001 From: joyqi Date: Thu, 20 May 2021 14:02:15 +0800 Subject: [PATCH] fix #1077 --- var/Widget/Contents/Post/Edit.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/var/Widget/Contents/Post/Edit.php b/var/Widget/Contents/Post/Edit.php index cb541163..3577de9f 100644 --- a/var/Widget/Contents/Post/Edit.php +++ b/var/Widget/Contents/Post/Edit.php @@ -130,8 +130,9 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg $created = $this->request->created; } else if (!empty($this->request->date)) { $dstOffset = !empty($this->request->dst) ? $this->request->dst : 0; - $timezoneOffset = $this->options->timezone; - $timezone = ($timezoneOffset >= 0 ? '+' : '-') . str_pad($timezoneOffset / 3600, 2, '0', STR_PAD_LEFT) . ':00'; + $timezoneSymbol = $this->options->timezone >= 0 ? '+' : '-'; + $timezoneOffset = abs($this->options->timezone); + $timezone = $timezoneSymbol . str_pad($timezoneOffset / 3600, 2, '0', STR_PAD_LEFT) . ':00'; list ($date, $time) = explode(' ', $this->request->date); $created = strtotime("{$date}T{$time}{$timezone}") - $dstOffset;