Judge "new" function: returns the number of seconds between today and tomorrow. If you want to determine whether a time value (expressed in seconds) is within the range of today. The following function makes it easy to judge. Function Source code: ------- If you want to determine whether a time value (expressed in seconds) is within the range of today based on the time. The following function makes it easy to judge.
Function Source code:
---------------------------------------------
Note: If $ varTime is within the range of today, true is returned; otherwise, false is returned.
Function bTodayToTomorrow ($ varTime)
{
$ NowYear = date ("Y ");
$ NowMonth = date ("n ");
$ NowDay = date ("j ");
$ AryTodayAndTomorrow ["Today"] = date ("U", mktime (0, 0, $ nowMonth, $ nowDay, $ nowYear ));
$ AryTodayAndTomorrow ["Tomorrow"] = date ("U", mktime (0, 0, $ nowMonth, ($ nowDay + 1), $ nowYear ));
If ($ varTime >=$ aryTodayAndTomorrow ["Today"] & $ varTime <$ aryTodayAndTomorrow ["Tomorrow"])
{
Return true;
}
Else
{
Return false;
}
}
------------------
Similarly, you can determine any time period.
Whether the period (in seconds) is within the range of today. The following function makes it easy to judge. Function Source code :-------...