Jump to content

Archived

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

mopar003

Scheduled time down

Recommended Posts

I need to be able to set the startDate/time and enddate/time and return if we are currently in that timeframe.  This is for a system maintenance between dateA at 4:00p to dateB at 12:00a.  Want to redirect user to a temp page.

I think it would go something like:

startDate:
startTime:
endDate:
endTime:

process and return true if currently in between start and end, or return false.

Share this post


Link to post
Share on other sites
[code]
$starttime = ;// unix timestamp format
$enddtime = ;// unix timestamp format
$currenttime = time();
if (($currenttime > $starttime) && ($currenttime < $endtime)) {
  header("location: temppage.php"); exit;
}
// normal page code here.
[/code]

Share this post


Link to post
Share on other sites

×

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.