Php output previous day last week last month last quarter
"; Echo date (" Y-m-d ", strtotime (" now ")," \ n "; echo""; Echo date (" Y-m-d ", strtotime ("-1 week Monday ")," \ n "; echo""; Echo date (" Y-m-d ", strtotime ("-1 week Sunday ")," \ n "; echo""; Echo date (" Y-m-d ", strtotime (" + 0 week Monday ")," \ n "; echo""; Echo date (" Y-m-d ", strtotime (" + 0 week Sunday ")," \ n "; echo""; Echo" ********* month: "; echo date ('N'); echo""; Echo" ********* weeks of the week: "; echo date (" w "); echo""; Echo" ********** number of days this month: "; echo date (" t "); echo""; Echo'
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""; 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""; Echo'
Last month:
'; Echo date ("Y-m-d H: I: s", mktime (0, 0, 0, date ("m")-2, 1, date ("Y"), "\ n"; echo date ("Y-m-d H: I: s", mktime (, 59, 59, date ("m")-1, 0, date ("Y"), "\ n"; echo""; 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""; 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"; echo""; Echo""; $ Season = ceil (date ('N')/3)-2; // the last quarter is the 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"; echo""; Echo""; $ Season = ceil (date ('N')/3)-1; // the last quarter is the 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"; echo""; Echo $ 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 quarter of the month echo'
Next 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"; echo""; ?>