Karimg Posted August 20, 2007 Share Posted August 20, 2007 What this script does, is well in my game i have resets, and i want this timer to show when reset is going to be, and right now it's set to every midnight, can someone tell me or give me a script that tells you every 6:00 PM and when it's 6:00 Pm it says Night reset blablabla. or can you make it so it will show how much minutes, seconds, and hours till 6:00 PM? $resethoursleft = 23 - $hour; if($resethoursleft < "10"){$resethoursleft = "0$resethoursleft";} $resetminutesleft = 59 - $minute; if($resetminutesleft < "10"){$resetminutesleft = "0$resetminutesleft";} $resetsecondsleft = 60 - $second; if($resetsecondsleft < "10"){$resetsecondsleft = "0$resetsecondsleft";} $h = "hours"; $m = "min."; $s = "sec."; if($resethoursleft > "0"){ $resethours = $resethoursleft*60; $resethours = $resethours*60; } if($resetminutesleft > "0"){ $resetminutes = $resetminutesleft*60; } $reset = $resetsecondsleft+$resetminutes+$resethours; echo " Current Game Time:<br> <b>$today, <span id=\"clock\"></span></b><br> <script type=\"text/javascript\"> new showLocalTime(\"clock\", \"server-php\", 0, \"short\") </script> Nightly Reset In:<br> <span id=\"tick_reset\"></span> <script language=\"JavaScript\"> <!-- CountDown('$reset','tick_reset','<b>Happening Right Now!<b>'); // --> </script><br></center> "; Quote Link to comment https://forums.phpfreaks.com/topic/65890-php-help-please/ Share on other sites More sharing options...
marcus Posted August 20, 2007 Share Posted August 20, 2007 $hour = date("G"); $reset = 18; //military hour if($hour >= $reset){ echo "RESETTTING\n"; }else { echo "FAIL."; } Quote Link to comment https://forums.phpfreaks.com/topic/65890-php-help-please/#findComment-329380 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.