PHP time functions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Flamie
Forum Contributor
Posts: 166
Joined: Mon Mar 01, 2004 3:19 pm

PHP time functions

Post by Flamie »

Hey guys, I'm wondering if theres an easy way to get the timestamp for monday at midnight of the current week, and friday midnight of the current week.

I thought of using strtotime's "last monday", but if the day is monday it will go 1 week behind.

Of course I can make some conditional checks and fix this, but I'm wondering if theres an easier way to go at it.

Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

mktime() mixed with a few date() calls would work.
Post Reply