php - strtotime returns 1970 when I remove a month? -


according php documentation, i'm using strtotime correctly, apparently i've managed wrong.

the following code:

echo date("y,n,j", strtotime($event["startdate"])); 

outputs: 2013,4,18 (which correct)

whereas following code (using exact same data):

echo date("y,n,j", strtotime('-1 month', $event["startdate"])); 

outputs: 1969,12,1 (instead of 2013,3,18)

why?

echo date("y,n,j", strtotime('-1 month', strtotime($event["startdate"])));


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -