Copy codeThe Code is as follows:
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 ";
// Date ('n') month
// Date ("w") the week of the week
// Date ("t") days of the month
Echo '<br> last week: <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: <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 ";
Echo '<br> last month: <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> this month: <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 ";
$ GetMonthDays = date ("t", mktime (0, 0, 0, date ('n') + (date ('n')-1) % 3, 1, date ("Y"); // the number of days in the current quarter before the last month
Echo '<br> this quarter: <br> ';
Echo date ('Y-m-d H: I: s', mktime (0, 0, 0, date ('n')-(date ('n ') -1) % 3, 1, date ('y'), "\ n ";
Echo date ('Y-m-d H: I: s', mktime (, 59, date ('n') + (date ('n')-1) % 3, $ getMonthDays, date ('y'), "\ n ";