From cb9bba12a9d9bc55394b59fd24f849cd48bc0c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 6 Dec 2017 14:53:56 +0800 Subject: [PATCH] * Fix end date bug --- lib/date/date.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/date/date.class.php b/lib/date/date.class.php index 561e0c7787..5cdee7a468 100644 --- a/lib/date/date.class.php +++ b/lib/date/date.class.php @@ -195,7 +195,7 @@ class date public static function getThisMonth() { $begin = date('Y-m') . '-01 00:00:00'; - $end = date('Y-m', strtotime('next month')) . '-00 23:59:59'; + $end = date('Y-m-d 23:59:59', strtotime("$begin +1 month -1 day")); return array('begin' => $begin, 'end' => $end); } @@ -208,7 +208,7 @@ class date public static function getLastMonth() { $begin = date('Y-m', strtotime('last month', strtotime(date('Y-m',time()) . '-01 00:00:01'))) . '-01 00:00:00'; - $end = date('Y-m', strtotime('this month')) . '-00 23:59:59'; + $end = date('Y-m-d 23:59:59', strtotime(date('Y-m-01') . ' -1 day')); return array('begin' => $begin, 'end' => $end); }