This is my program :
$newEndingDate = strtotime(date("Y-m-d", strtotime($row['startdate']))."+1 year");
echo $newEndingDate;
this is my error
1332441000
whats the error
This is my program :
$newEndingDate = strtotime(date("Y-m-d", strtotime($row['startdate']))."+1 year");
echo $newEndingDate;
this is my error
1332441000
whats the error
The strtotime()
function returns an UNIX Timestamp : the number of seconds since 1970-01-01.
The number you are getting is not an error : it just means that 1332441000 seconds have passed since 1970.
If necessary, you can use the date()
function to format that timestamp, to get a string that looks a bit more user-friendly.
For instance :
echo date('Y-m-d H:i:s', $newEndingDate);
should get you the following result :
2012-03-22 19:30:00