My site is now limited access time is 24-hour system, that is, from the start time from 00:01 to 24:00 to end, now I want from the start of 10:00 to 02:00 end is not used, how can I use code to restrict time access?
Reply to discussion (solution)
Gets the current time, not the allowable time period to give a hint ...
24-hour, start time 10:00 to 02:00 end
Isn't that a cross-day?
So you have to set it in 2 paragraphs.
00:00 to 02:00
10:00 to 24:00
24-hour, start time 10:00 to 02:00 end
Isn't that a cross-day?
So you have to set it in 2 paragraphs.
00:00 to 02:00
10:00 to 24:00
Can you send out the code?
You used to have a similar
Date (' H:i ') >= $ start time and date (' h:i ') < end time
Such a discrimination
Adding a distinction is
Date (' H:i ') >= $ start time 1 and date (' h:i ') < end time 1
Or
Date (' H:i ') >= $ start Time 2 and date (' h:i ') < end time 2
You used to have a similar
Date (' H:i ') >= $ start time and date (' h:i ') < end time
Such a discrimination
Adding a distinction is
Date (' H:i ') >= $ start time 1 and date (' h:i ') < end time 1
Or
Date (' H:i ') >= $ start Time 2 and date (' h:i ') < end time 2
Does this not conflict?
You used to have a similar
Date (' H:i ') >= $ start time and date (' h:i ') < end time
Such a discrimination
Adding a distinction is
Date (' H:i ') >= $ start time 1 and date (' h:i ') < end time 1
Or
Date (' H:i ') >= $ start Time 2 and date (' h:i ') < end time 2
Moderator, trouble to give a complete code.
What's the rush?
You used to have a similar
Date (' H:i ') >= $ start time and date (' h:i ') < end time
Such a discrimination
Adding a distinction is
Date (' H:i ') >= $ start time 1 and date (' h:i ') < end time 1
Or
Date (' H:i ') >= $ start Time 2 and date (' h:i ') < end time 2
Does this not conflict?
What's the rush?
You used to have a similar
Date (' H:i ') >= $ start time and date (' h:i ') < end time
Such a discrimination
Adding a distinction is
Date (' H:i ') >= $ start time 1 and date (' h:i ') < end time 1
Or
Date (' H:i ') >= $ start Time 2 and date (' h:i ') < end time 2
Does this not conflict?
Moderator, could you please send me all the code?
You can't write?
Then put your old part out.
Or I'll write it for you, and you won't get in.
You can't write?
Then put your old part out.
Or I'll write it for you, and you won't get in.
Prompt time check $fromtime=strtotime (date (' y-m-d ', $this->time). $this->settings[' cashfromtime ']. ': 0 0 '); $toTime =strtotime (Date (' y-m-d ', $this->time). $this->settings[' cashtotime ']. ': 0 0 '); if ($this->time < $fromTime | | $this->time > $toTime) throw new Exception ("Sorry, the time has been raised, please submit it at the right time!")
Withdrawal time: ". $this->settings[' Cashfromtime ']." ~ ". $this->settings[' cashtotime '); $this->begintransaction (); try{$this->freshsession (); if ($this->user[' Coinpassword ']!=md5 ($para [' coinpwd ']) throw new Exception (' Incorrect money password '); unset ($para [' coinpwd ']); if ($this->user[' coin ']< $para [' Amount ']) throw new Exception (' Your account is underfunded ');
This is the code
When you visit the time you use PHP to determine the current times, if it is allowed within the time to continue to run, or go home!
When you visit the time you use PHP to determine the current times, if it is allowed within the time to continue to run, or go home!
Prompt time check $fromtime=strtotime (date (' y-m-d ', $this->time). $this->settings[' cashfromtime ']. ': 0 0 '); $toTime =strtotime (Date (' y-m-d ', $this->time). $this->settings[' cashtotime ']. ': 0 0 '); if ($this->time < $fromTime | | $this->time > $toTime) throw new Exception ("Sorry, the time has been raised, please submit it at the right time!")
Withdrawal time: ". $this->settings[' Cashfromtime ']." ~ ". $this->settings[' cashtotime '); $this->begintransaction (); try{$this->freshsession (); if ($this->user[' Coinpassword ']!=md5 ($para [' coinpwd ']) throw new Exception (' Incorrect money password '); unset ($para [' coinpwd ']); if ($this->user[' coin ']< $para [' Amount ']) throw new Exception (' Your account is underfunded ');
is currently 24-hour system, I need is a cross-day time, such as 08 to 02 points, above is my PHP code, how to change?
Strtotime (Date ("y-m-d")),//00:00strtotime (Date ("y-m-d 02:00"),//02:00strtotime (Date ("y-m-d 22:00"));// 22:00strtotime (Date ("y-m-d 24:00"));//24:00