function fakeDate($format, $timestamp = null)
{
    if ($timestamp === null) {
        $timestamp = time();
    }
    return real_date($format, $timestamp);
}
Ejemplo n.º 2
0
function indaterange($date1, $date2)
{
    if (real_date($date1)) {
        $dateArray = getDateArray($date1);
        $unix1 = mktime($dateArray['Hour'], $dateArray['Minute'], $dateArray['Second'], $dateArray['Month'], $dateArray['Day'], $dateArray['Year']);
    } else {
        $unix1 = 0;
    }
    if (real_date($date2)) {
        $dateArray = getDateArray($date2);
        $unix2 = mktime($dateArray['Hour'], $dateArray['Minute'], $dateArray['Second'], $dateArray['Month'], $dateArray['Day'], $dateArray['Year']);
    } else {
        $unix2 = 0;
    }
    $ctime = time();
    return ($unix1 == 0 || $unix1 <= $ctime) && ($unix2 == 0 || $unix2 >= $ctime);
}