PHP Get Time Code summary share

Source: Internet
Author: User
This article is mainly to share with you the PHP acquisition time code summary, hoping to let the small partners to PHP acquisition time has a deeper understanding and mastery.

  1. <?php echo Date ("Ymd", Strtotime ("Now"), "\ n";      echo Date ("Ymd", Strtotime ("1 week Monday")), "\ n";      echo Date ("Ymd", Strtotime ("1 week Sunday")), "\ n";      echo Date ("Ymd", Strtotime ("+0 Week Monday")), "\ n";         echo Date ("Ymd", Strtotime ("+0 Week Sunday")), "\ n";      echo "********* months:";      echo Date (' n ');      echo "********* Week of the week:";      Echo Date ("W");      echo "********* Days of the Month:";      echo Date ("T");      echo "*********";    Echo ' <br> specific weeks </br> ' on last week;      echo Date (' y-m-d ', Strtotime ('-1 Monday ', $time));      Echo ' <br> last week start time:<br> ';      echo Date ("Y-m-d h:i:s", mktime (0, 0, 0,date ("M"), Date ("D")-date ("W") +1-7,date ("Y")), "\ n";      echo Date ("Y-m-d h:i:s", Mktime (23,59,59,date ("M"), Date ("D")-date ("W") +7-7,date ("Y")), "\ n";      Echo ' <br> this week start time:<br> ';      echo Date ("Y-m-d h:i:s", mktime (0, 0, 0,date ("M"), Date ("D")-date ("W") +1,date ("Y")), "\ n"; echo Date ("Y-m-d h:i:s", Mktime (23,59,59,date ("M"), Date ("D")-date ("W") +7,daTe ("Y"))), "\ n";      Find the start date and end date of the week from the first week $dayNumber = Date (' W ') * 7; $weekDayNumber = Date ("W", Mktime (0, 0, 0, 1, $dayNumber, date ("Y"))),//day of the current week $startNumber = $dayNumber-$weekDayN      umber; echo Date ("Y-m-d", mktime (0, 0, 0, 1, $startNumber + 1, date ("Y")));//Start date echo date ("Y-m-d", mktime (0, 0, 0, 1, $sta      Rtnumber + 7, date ("Y"));//End date echo ' <br> last month start time:<br> ';      echo Date ("Y-m-d h:i:s", mktime (0, 0, 0,date ("M") -1,1,date ("Y")), "\ n";      echo Date ("Y-m-d h:i:s", Mktime (23,59,59,date ("M"), 0,date ("Y")), "\ n";      Echo ' <br> month start time:<br> ';      echo Date ("Y-m-d h:i:s", mktime (0, 0, 0,date ("M"), 1,date ("Y")), "\ n";         echo Date ("Y-m-d h:i:s", Mktime (23,59,59,date ("M"), Date ("T"), Date ("Y")), "\ n";      $season = Ceil ((date (' n '))/3);//month of the first quarter echo ' <br> this quarter start time:<br> ';      echo Date (' y-m-d h:i:s ', mktime (0, 0, 0, $season *3-3+1,1,date (' Y ')), "\ n"; echo Date (' y-m-d h:i:s ', Mktime (23,59,59, $season *3,date (' t ',Mktime (0, 0, 0, $season *3,1,date ("y"))), date (' Y ')), "\ n";      $season = Ceil ((date (' n '))/3) -1;//last quarter was the first quarter of ECHO ' <br> last quarter start time:<br> ';      echo Date (' y-m-d h:i:s ', mktime (0, 0, 0, $season *3-3+1,1,date (' Y ')), "\ n"; echo Date (' y-m-d h:i:s ', Mktime (23,59,59, $season *3,date (' t ', mktime (0, 0, 0, $season *3,1,date ("y"))), date (' Y ')), "\ n"  ; ?>

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.