Introduction: This is a detailed page on PHP time processing. It introduces the related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 332638 'rolling = 'no'>
(1) print the timestamp strtotime ("+ 1 day") at this time tomorrow.
Current Time: Echo date ("y-m-d h: I: S", time () Result: 09:40:25
Time specified: Echo date ("Y-m-d h: I: s", strtotime ("+ 1 day") Result: 09:40:25
(2) print the timestamp strtotime ("-1 day") at this time yesterday.
Current Time: Echo date ("y-m-d h: I: S", time () Result: 09:40:25
Time specified: Echo date ("Y-m-d h: I: s", strtotime ("-1 day") Result: 09:40:25
(3) print the timestamp strtotime ("+ 1 week") for the next week.
Current Time: Echo date ("y-m-d h: I: S", time () Result: 09:40:25
Time specified: Echo date ("Y-m-d h: I: s", strtotime ("+ 1 week") Result: 09:40:25
(4) print the timestamp strtotime ("-1 week") for the last week.
Current Time: Echo date ("y-m-d h: I: S", time () Result: 09:40:25
Time specified: Echo date ("Y-m-d h: I: s", strtotime ("-1 week") Result: 09:40:25
(5) print the specified timestamp strtotime ("next Thursday") for the next week.
Current Time: Echo date ("y-m-d h: I: S", time () Result: 09:40:25
Time specified: Echo date ("Y-m-d h: I: s", strtotime ("next Thursday") Result: 00:00:00
(6) print the timestamp strtotime ("last Thursday") of the specified last week.
Current Time: Echo date ("y-m-d h: I: S", time () Result: 09:40:25
Specified Time: Echo date ("Y-m-d h: I: s", strtotime ("last Thursday") Result: 00:00:00
The preceding example shows that strtotime can parse the datetime description of any English text into a Unix timestamp. We can use mktime () or date () to format the datetime to get the specified timestamp, the date and time required for implementation.
These are the specific concepts of the PHP strtotime function.
More articles on "processing PHP time"
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/332638.html pageno: 11.