This article mainly introduces the implementation of PHP for the date, month, days, weeks, hours, minutes, seconds, such as the addition and subtraction, combined with examples of the form of a simple date-time algorithm based on strtotime, very practical value, the need for friends can refer to the next
This is actually strtotime
the built-in function
PHP date plus minus week date ("Y-m-d", Strtotime ("2013-11-12 +1 Week"))//php date plus minus days ("y-m-d", Strtotime ("2013-11-12 12:12:12 +1 da Y "))//php date plus minus hour date (" Y-m-d h:i:s ", Strtotime (" 2013-11-12 12:12:12 +1 Hour "))//php date plus minus number of months date (" y-m-d ", Strtotime (" 2013-11-12 12:12:12 +1 Month "))//php date plus minus point date (" Y-m-d h:i:s ", Strtotime (" 2013-11-12 12:12:12 +1 Minute "))//php date plus minus seconds dat E ("y-m-d h:i:s", Strtotime ("2013-11-12 12:12:12 +1 Second"))
The above is the whole content of this article, I hope that everyone's study has helped.