These time functions have been released. You don't need to use them! If you have any questions, you can leave a message below. I will reply in time to make friends ~
The Code is as follows: |
Copy code |
<? Php // Get the difference in days between two dates Function SubDay ($ ntime, $ ctime) { $ Dayst = 3600*24; $ Cday = ceil ($ ntime-$ ctime)/$ dayst ); Return $ cday; } // Obtain the number of days after the current time. The unit for increasing the number of days is 1. Function AddDay ($ ntime, $ aday) { $ Dayst = 3600*24; $ Oktime = $ ntime + ($ aday * $ dayst ); Return $ oktime; } // Obtain the day of the week.
Function AddSpeDay ($ day = 0) { // $ Day = isset ($ day )? Intval ($ day): 0; $ Daynum = date ('W')-$ day; $ Oktime = time ()-(3600*24 * $ daynum ); Return $ oktime; } # Method for retrieving the current time in php // Obtain the current time, in the format of 14:20:35 Function GetDateTimeMk ($ mktime) { Return MyDate ('Y-m-d H: I: s', $ mktime ); } // Obtain the current time in the format of 2009-10-23 Function GetDateMk ($ mktime) { Return MyDate ("Y-m-d", $ mktime ); } ?> |