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. Quote 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] Quote 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? Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/25076-scheduled-time-down/#findComment-114304 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.