Php gets next week, this week, next month, this month, this quarter, next quarter

Source: Internet
Author: User
Php obtained last week, this week, last month, this month, and this quarter. Source: hudeyong926.iteye. comblog729193 & lt ;? Phpechodate (Ymd, strtotime (now), n; echodate (Ymd, strtotime (-1 weekMonday), n; echoda php get last week, this week, last month, this month, this quarter, last quarter

Source: http://hudeyong926.iteye.com/blog/729193


 Last week:
'; 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'
This week:
'; 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"; echo'
Last month:
'; 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 (, 59, 59, date ("m"), 0, date ("Y"), "\ n"; echo'
This month:
'; 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 (, 59, 59, date ("m"), date ("t"), date ("Y"), "\ n "; $ season = ceil (date ('N')/3); // The quarter of the month echo'
This quarter:
'; 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 (, 59, 59, $ season * 3, date ('t', mktime (0, 0, 0, $ season * 3, 1, date ("Y "))), date ('Y'), "\ n"; $ season = ceil (date ('N')/3)-1; // the first quarter of the last quarter echo'
Last quarter:
'; 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 (, 59, 59, $ season * 3, date ('t', mktime (0, 0, 0, $ season * 3, 1, date ("Y "))), date ('Y'), "\ n";?> Php dates minus days ?

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.