I wanna ask, how to min or plus a year in php I have a date like this 1992-09-10 then I'm using timespan (codeigniter library) to knowing, how long the date is,
here's the code
$time = '1992-09-10';
$timeago = timespan(strtotime($time));
echo $timeago;
then the result is
24 Years, 1 Month, 3 Weeks, 2 Days, 23 Hours, 51 Minutes
and I want to decrease (-5) years the result should be
19 Years, 1 Month, 3 Weeks, 2 Days, 23 Hours, 51 Minutes
my code is
$time = '1992-09-10';
$timeago = timespan(strtotime('-5 years', strtotime($time)));
echo $timeago;
but the result is
29 Years, 1 Month, 3 Weeks, 3 Days, 17 Hours, 54 Minutes
anyone know to make it?
Sorry for my bad english