mopar003 Posted October 25, 2006 Share Posted October 25, 2006 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. Link to comment https://forums.phpfreaks.com/topic/25076-scheduled-time-down/ Share on other sites More sharing options...
.josh Posted October 25, 2006 Share Posted October 25, 2006 [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] Link to comment https://forums.phpfreaks.com/topic/25076-scheduled-time-down/#findComment-114294 Share on other sites More sharing options...
mopar003 Posted October 25, 2006 Author Share Posted October 25, 2006 That will work. Now whats the best way to convert 10-25-2006 10:00 to unix timestap? Link to comment https://forums.phpfreaks.com/topic/25076-scheduled-time-down/#findComment-114299 Share on other sites More sharing options...
.josh Posted October 25, 2006 Share Posted October 25, 2006 http://us3.php.net/manual/en/function.mktime.php Link to comment https://forums.phpfreaks.com/topic/25076-scheduled-time-down/#findComment-114304 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.