I have a DateTime of current day. I need to get two unix timestamps of beggining and ending of current week. How can I use dateperiod or dateinterval class?
$now = time();
$beginning_of_week = strtotime('last Monday', $now); // Gives you the time at the BEGINNING of the week
$end_of_week = strtotime('next Sunday', $now) + 86400; // Gives you the time at the END of the last day of the week
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With