I have the following situation:
$birth = new DateTime('1960');
echo $birth->diff( new DateTime() )->format('%y');
The output is 56 - that is OK, but when I set an argument 1959 or less value I got result 0. For example:
$birth = new DateTime('1959');
echo $birth->diff( new DateTime() )->format('%y');
The output is 0.
The test environment is:
- PHP 5.5.9-1ubuntu4.17
- Apache/2.4.10 (Ubuntu)
Thanks!