Jump to content

opening, closing date


dvayne

Recommended Posts

to compare dates they need to be in YYYY-mm-dd format or as unix timestamps.

 

Using the latter

<?php
$start = strtotime('april 1, 2008');
$end = strtotime('april 3, 2008');

$now = mktime(0,0,0);

if ($start <= $now && $now <= $end)
{
    echo "OK to post";
}
else {
    echo "No posting"
}
?>

Link to comment
https://forums.phpfreaks.com/topic/99065-opening-closing-date/#findComment-506922
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.