PHP _php tutorial for date processing experience set

Source: Internet
Author: User
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 $ ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.