An excellent PHP script to handle time difference
I am working on a project that involves displaying the time difference between a start and end time on a website. The following script is lifted directly from: http://aidanlister.com/2004/04/making-time-periods-readable/ /** * A function for making time periods readable * * @author Aidan Lister * @version 2.0.0 * @link http://aidanlister.com/2004/04/making-time-periods-readable/ * @param int number of seconds elapsed * @param string which time periods to display * @param bool whether to show zero time periods */ function time_duration($seconds, $use = null, $zeros = false) { // Define time periods $periods = array ( 'years' => 31556926, 'Months' => 2629743, 'weeks' => 604800, 'days' => 86400, 'hours' => 3600, 'minutes' => 60, 'seconds' => 1 ); // Break into peri