Just a quickie.. How to derive the unixtime of nearest March or June?
If the current month is February of 2009, the script should give the unixtime of March 01, 2009.
If the current month is April of 2009, the script should give the unixtime of June 01, 2009.
If the current month is October of 2009, the script should give the unixtime of March 01, 2010.
Thank you for any help!
Update: Sorry, my bad. "next" works with days and in cases like "next month" but not "next March" so it's a little more convoluted than the original one liner.
strtotime()
is really awesome for things like this:Output:
Also see What date formats does the PHP function strtotime() support?