In PHP given a UTC timestamp I would like to add exactly N number of years. This should take into consideration leap years.
Thank you.
$newTimestamp = strtotime('+2 years', $timestamp);
Replace "+2 years" as required.
ref: http://php.net/manual/en/function.strtotime.php
How to find the time elapsed since a date time stamp like 2010-04-28 17:25:43, final out put text should be like xx Minutes Ago/xx Days Ago
I am of of the understanding that due to the nature that PHP represents dates using milliseconds, you cannot represent dates past 2038. I have a problem where I want to calculate dates far in the future. Thousands of years away. …
How to calculate minute difference between two date-times in PHP?