views:

40

answers:

1

How can I find the Unix Timestamp of midnight on (the beginning of) the most previous Monday?

+4  A: 

Use strtotime

date("r", strtotime("last monday"));

yields

Mon, 28 Jun 2010 00:00:00 -0700
Justin Johnson
that actually works??
Kip
strtotime is magic (the good kind)
Justin Johnson
mk, i've glanced at `strtotime()` but it's one of those things that makes me go "Are you suuure?"
jordanstephens
PHP has a lot of magic. That's why we love and hate it so much.
Lotus Notes