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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.