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); }