src/Utility/Time.php
public static function difference($startTime, $endTime = null, array $options = []) {
		if (!is_int($startTime)) {
			$startTime = strtotime($startTime);
		}
		if (!is_int($endTime)) {
			$endTime = strtotime($endTime);
		}
		//@FIXME: make it work for > month
		return abs($endTime - $startTime);
	}
public static function difference($startTime, $endTime = null, array $options = []) {
		if (!is_int($startTime)) {
			$startTime = strtotime($startTime);
		}
		if (!is_int($endTime)) {
			$endTime = strtotime($endTime);
		}
		//@FIXME: make it work for > month
		return abs($endTime - $startTime);
	}
public static function difference ( $ startTime , $ endTime = null , array $ options = [ ] ) { if ( ! is_int ( $ startTime ) ) { $ startTime = strtotime ( $ startTime ) ; } if ( ! is_int ( $ endTime ) ) { $ endTime = strtotime ( $ endTime ) ; } //@FIXME: make it work for > month return abs ( $ endTime - $ startTime ) ; }
Calculate the difference between two dates

TODO: deprecate in favor of DateTime::diff() etc which will be more precise

should only be used for < month (due to the different month lenghts it gets fuzzy)

@param mixed $startTime (db format or timestamp)
@param mixed|null $endTime (db format or timestamp)
@param array $options
@return int The distance in seconds
Calculate the difference between two dates