The PHP computing time period is the day of the week, the day after the current time and the time difference between the date. 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 following code copies all these time functions. 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: |
|
// 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 ); } ?> |
Success! If you have any questions, you can leave a message below. I will reply in time to make friends ~ The code is as follows...