这几个时间函数都放出来了,使用方法不用说了吧,直接看代码:
- <?php
-
- function SubDay($ntime,$ctime)
- {
- $dayst = 3600 * 24;
- $cday = ceil(($ntime-$ctime)/$dayst);
- return $cday;
- }
-
- function AddDay($ntime,$aday)
- {
- $dayst = 3600 * 24;
- $oktime = $ntime + ($aday * $dayst);
- return $oktime;
- }
-
- function AddSpeDay($day=0)
- {
-
- $daynum = date(‘w’) – $day;
- $oktime = time() – (3600 * 24 * $daynum);
- return $oktime;
- }
- #附php取当前时间的方法
-
- function GetDateTimeMk($mktime)
- {
- return MyDate(‘Y-m-d H:i:s’,$mktime);
- }
-
- function GetDateMk($mktime)
- {
- return MyDate(“Y-m-d”,$mktime);
- }
- ?>
|