function currentMonth($time)
{
$info['start'] = strtotime(date( 'Y-m-1 00:00:00', $time ));
$mdays = date( 't', $time );
$info['end'] = strtotime(date( 'Y-m-' . $mdays . ' 23:59:59', $time ));
return $info;
}
function lastMonth($time)
{
$datetime = date('Ymd',$time);
$info['start'] = strtotime(date("Y-m-1 00:00:00",strtotime("last months",strtotime($datetime))));
$mdays = date( 't', $time );
$info['end'] = strtotime(date( 'Y-m-' . $mdays . ' 23:59:59', $info['start']));
return $info;
}
function currentYear($time)
{
$info['start'] = strtotime(date( 'Y-01-01 00:00:00', $time ));
$info['end'] = strtotime(date( 'Y-12-31 23:59:59', $time ));
return $info;
}
function lastYear($time)
{
$info['start'] = strtotime(date( 'Y-01-01 00:00:00', strtotime("-1 years",$time) ));
$info['end'] = strtotime(date( 'Y-12-31 23:59:59', strtotime("-1 years",$time) ));
return $info;
}