mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2026-01-13 11:40:30 +00:00
[fix] TimeLock
This commit is contained in:
parent
261189ec3b
commit
2926646db3
@ -56,8 +56,12 @@ trait TimeLock
|
|||||||
*/
|
*/
|
||||||
public static function timing(int $hour, int $minute = 0, int $seconds = 0): int
|
public static function timing(int $hour, int $minute = 0, int $seconds = 0): int
|
||||||
{
|
{
|
||||||
// now today tomorrow yesterday
|
$time = strtotime('today') + ($hour * 60 * 60) + ($minute * 60) + ($seconds);
|
||||||
return strtotime('tomorrow') + ($hour * 60 * 60) + ($minute * 60) + ($seconds) - time();
|
if ($time > time()) {
|
||||||
|
return strtotime('today') + ($hour * 60 * 60) + ($minute * 60) + ($seconds) - time();
|
||||||
|
} else {
|
||||||
|
return strtotime('tomorrow') + ($hour * 60 * 60) + ($minute * 60) + ($seconds) - time();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user