waynew Posted September 7, 2008 Share Posted September 7, 2008 Hey guys. Say I have a date, taken from MySQL. How would I go about calculating their age? Is there a specific (custom of course) function that anyone has ready to spare? Also, I'm allowing users to post to each other and want to have a one minute period where you can't send another message to a user that you already messaged. (To stop spam etc). I'm guessing timestamps are the way to go about this. How would I go about calculating the time in seconds (in difference) between two timestamps? Thanks! Link to comment https://forums.phpfreaks.com/topic/123170-date-of-birth-timestamp-comparisons/ Share on other sites More sharing options...
Brandon Jaeger Posted September 7, 2008 Share Posted September 7, 2008 To calculate the difference between two timestamps, simply subtract one from the other (newest first). Link to comment https://forums.phpfreaks.com/topic/123170-date-of-birth-timestamp-comparisons/#findComment-636135 Share on other sites More sharing options...
burn1337 Posted September 7, 2008 Share Posted September 7, 2008 you could use mktime() for both of those, but also the date verification if your using the date all numericly then you can just basicly subtract it I believe, haven't tried that yet Link to comment https://forums.phpfreaks.com/topic/123170-date-of-birth-timestamp-comparisons/#findComment-636138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.