Date synthesized by year, month and day
function DateSerial ($nyear, $nmonth, $nday)
{
Return date ("Y/n/j", Mktime (0,0,0, $nmonth, $nday, $nyear));
}
$now _rq=date ("y/n/j");//go to the present date
$year =date (Y);//Acquired year
$month =date (m);//Take the Month
$month =date (j);//Date Taken
Get the first and last day of the quarter from the month
Switch ($month) {
Case 1:
Case 2:
Case 3:
$quarter _begin=dateserial ($year -1,10,1);
$quarter _end=dateserial ($year -1,12,31);
Break
Case 4:
Case 5:
Case 6:
$quarter _begin=dateserial ($year, 1, 1);
$quarter _end=dateserial ($year, 3,31);
Break
Case 7:
Case 8:
Case 9:
$quarter _begin=dateserial ($year, 4, 1);
$quarter _end=dateserial ($year, 6,30);
Break
Case 10:
Case 11:
Case 12:
$quarter _begin=dateserial ($year, 7, 1);
$quarter _end=dateserial ($year, 9,30);
Break
}
http://www.bkjia.com/PHPjc/532237.html www.bkjia.com true http://www.bkjia.com/PHPjc/532237.html techarticle //Yunin, month, day synthesis date function dateserial ($nyear, $nmonth, $nday) {return date ("Y/n/j", Mktime (0,0,0, $nmonth, $nday, $nyear) ); } $now _rq=date ("y/n/j");//go to the current date $ ...