PHP: strtotime()… again
Question
How do I have to write "+3 days at 12:34:56" to make strtotime() parse it properly?
Solution
$ts = strtotime("12:34:56 +3 days");
echo date('Y-m-d H:i:s O', $ts);
prints
2009-09-23 12:34:56 +0200
(my local timezone is CEST/gmt+2)
OTHER TIPS
Oh, I got it: I just had to remove the "at": "+3 days 12:34:56" parses, yay!
personally I'd do something like this:
date("Y-m-d 12:34:56",time()+(60*60*24*3))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow