How to fix this error in PHP: "Invalid generated numeric value"

Possible duplicate:
Invalid numeric value

Why is this not working?

echo gmdate('Ymd H:i:s',strtotime('+7 days','2035-01-01 00:00:00')); 

I see an error:

Invalid numeric value

+6
source share
1 answer

The second strtotime parameter expects strtotime time, not a string. See the strtotime .

You can use strtotime again for the second parameter to get what you want:

 echo gmdate('Ymd H:i:s',strtotime('+7 days',strtotime('2035-01-01 00:00:00'))); 
+25
source

All Articles