WPDKDateTime::daysToDate PHP Method

daysToDate() public static method

Return the days to a expiration date from now. Return the days to up ($date > now) or days expired ($date < now).
public static daysToDate ( integer $date ) : float
$date integer A timestamp date
return float
    public static function daysToDate($date)
    {
        $diff = $date - time();
        $days = floatval(round($diff / (60 * 60 * 24)));
        return $days;
    }