pthurmond Posted December 4, 2006 Share Posted December 4, 2006 Are there any functions for calculating someones age from their date of birth in php? I don't suppose it would be as easy as subtracting their date of birth from the current date.Also I need to be able to record time from the users time zone for signin times. Any suggestions as to how to get the time for their time zones?Oh and does php have any pre-designed functions to convert time from the hour:min AM/PM format to military time?Thanks,Patrick Link to comment https://forums.phpfreaks.com/topic/29371-calculating-age-from-date-of-birth-also-time-zone-issues/ Share on other sites More sharing options...
btherl Posted December 4, 2006 Share Posted December 4, 2006 All your answers are here:http://sg.php.net/manual/en/ref.datetime.phpI would recommend checking out date() and strtotime(), and have a read of the comments below. Many people have posted useful code in the comments.Edit: As for time zones, the forum software I've seen asks the user for their time zone on registration :) A lot try to guess the time zone with geolocation stuff, which I know little about.. but it seems quite effective. Link to comment https://forums.phpfreaks.com/topic/29371-calculating-age-from-date-of-birth-also-time-zone-issues/#findComment-134701 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.