Monday, July 21, 2008

Cool and easy way to find timestamp

I just find this is cool and useful when try to try a timestamp for particular date in PHP. Of course, there are many ways to do it, but may you find this one quick and easy in PHP.

echo strtotime("now"), "\n";
echo strtotime("10 September 2000"), "\n";
echo strtotime("+1 day"), "\n";
echo strtotime("+1 week"), "\n";
echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";
echo strtotime("next Thursday"), "\n";
echo strtotime("last Monday"), "\n";