* Fix end date bug

This commit is contained in:
滔哥
2017-12-06 14:53:56 +08:00
parent 75fdcaa780
commit cb9bba12a9
+2 -2
View File
@@ -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);
}