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

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -