Created
April 25, 2013 03:08
-
-
Save 2tunnels/5457236 to your computer and use it in GitHub Desktop.
Get age from birth date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $timezone = new DateTimeZone('Europe/Brussels'); | |
| $age = DateTime::createFromFormat('Y-m-d H:i:s', '1990-09-12 00:00:00', $timezone) | |
| ->diff(new DateTime('now', $timezone)) | |
| ->y; | |
| return $age; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment