public static function diff($date1, $date2, $type = 'days', $round = true) {
		$result = strtotime($date2) - strtotime($date1);
		switch ($type) {
			case 'days':
				$result = $result / 86400;
				break;
			case 'abs days':
				$result = abs($result / 86400);
				break;
			case 'seconds':
				return $result;
				break;
			case 'abs seconds':
				return abs($result);
				break;
		}
		// rounding
		if ($round) {
			$result = (int) round($result);
		}
		return $result;
	}