public static function isInRangeDatetime($date_start, $date_expire, $format = 'YmdHis', $timestamp = false)
{
_deprecated_function(__CLASS__ . '::' . __FUNCTION__, '1.5.16', '');
if (!empty($date_start) || !empty($date_expire)) {
/* Get now in timestamp */
$now = mktime();
/* Le date sono in chiaro o anch'esse in timestamp? */
/* @todo qui si potrebbe provare a capire in automatico se la data è in timestamp o stringa, ad esempio usando is_numeric() */
if (!$timestamp) {
$date_start = !empty($date_start) ? strtotime($date_start) : $now;
$date_expire = !empty($date_expire) ? strtotime(${$date_expire}) : $now;
} else {
$date_start = !empty($date_start) ? $date_start : $now;
$date_expire = !empty($date_expire) ? $date_expire : $now;
}
/* Verifico il range. */
if ($now >= $date_start && $now <= $date_expire) {
return true;
}
}
return false;
}