获取上月的时间,本月的时间


2018-05-17 17:12:36 by sikoay with 2 comments 1 Hits
Blog 1
function getMonth($date){
  $firstday=date("Y-m-01",strtotime($date));
  $lastday=date("Y-m-d",strtotime("$firstday +1 month -1 day"));
  returnarray($firstday,$lastday);
}


function getNextMonthDays($date){
  $timestamp=strtotime($date);
  $arr=getdate($timestamp);
  if($arr['mon'] == 12){
    $year=$arr['year'] +1;
    $month=$arr['mon'] -11;
    $firstday=$year.'-0'.$month.'-01';
    $lastday=date('Y-m-d',strtotime("$firstday +1 month -1 day"));
  }else{
    $firstday=date('Y-m-01',strtotime(date('Y',$timestamp).'-'.(date('m',$timestamp)+1).'-01'));
    $lastday=date('Y-m-d',strtotime("$firstday +1 month -1 day"));
  }
  returnarray($firstday,$lastday);
}


Tags:

回复 (2)

cizemowhi

2019-10-07 12:34:46

http://mewkid.net/buy-xalanta/ - Amoxicillin 500mg Capsules <a href="http://mewkid.net/buy-xalanta/">Amoxicillin 500mg Capsules</a> vmz.lzby.sikoay.com.rpy.ne http://mewkid.net/buy-xalanta/

ewonatipoda

2019-10-07 13:01:50

http://mewkid.net/buy-xalanta/ - Buy Amoxicillin <a href="http://mewkid.net/buy-xalanta/">Amoxicillin Online</a> adw.jivs.sikoay.com.uyz.rq http://mewkid.net/buy-xalanta/

Leave a Comment