rarebit Posted January 3, 2009 Share Posted January 3, 2009 Is this correct, is there a built in way... function time_since($t) { $secs = $t % 60; $mins = floor(($t % 3600)/60); $hours = floor(($t % 86400)/3600); $days = floor(($t % 604800)/86400); $weeks = floor(($t % 31449600)/604800); $years = floor($t / 31449600); print "secs: ".$secs."<br>"; print "mins: ".$mins."<br>"; print "hours: ".$hours."<br>"; print "days: ".$days."<br>"; print "weeks: ".$weeks."<br>"; print "years: ".$years."<br>"; } time_since(225011227); Thanks! Link to comment https://forums.phpfreaks.com/topic/139357-time-explained/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.