php - Get timestamps of current week -
I have the date time of the present day. I need to get two Unix timestamps for the start and end of the current week. How can I use the dateperiod or dateinterval class?
$ Start_of_week = strtotime ('last Monday', $ now); // week BEGINNING finally gives you $ end_of_week = strtotime ('next Sunday', $ now) + 86400; // gives you time at the end of the last day of the week
Comments
Post a Comment