Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix this error in PHP: "A non well formed numeric value encountered" [duplicate]

Tags:

php

strtotime

Possible Duplicate:
A non well formed numeric value encountered

Why doesn't this work?

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

The error I see is:

A non well formed numeric value encountered

like image 642
Jo Smo Avatar asked Aug 14 '12 17:08

Jo Smo


1 Answers

The second parameter of strtotime expects a timestamp, not a string. See the manual on strtotime.

You can use strtotime again on your second parameter to get what you want:

echo gmdate('Y-m-d H:i:s',strtotime('+7 days',strtotime('2035-01-01 00:00:00')));
like image 123
Blake Avatar answered Oct 14 '22 17:10

Blake