views:

119

answers:

3

How do I have to write "+3 days at 12:34:56" to make strtotime() parse it properly?

+1  A: 

Oh, I got it: I just had to remove the "at": "+3 days 12:34:56" parses, yay!

Tilka
+6  A: 
$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)

VolkerK
A: 

personally I'd do something like this:

date("Y-m-d 12:34:56",time()+(60*60*24*3))
Mikey