Home  >  Article  >  Backend Development  >  How to add one month to time in php

How to add one month to time in php

L
LOriginal
2020-06-02 12:13:426416browse

How to add one month to time in php

phpHow to add one month to the time

Use php’s strtotime() function

Example: For example, the current time is "2010-10-06", plus one month. 1653

echo   date("Y-m-d", strtotime("+1 months", strtotime("2010-10-06")));

Specific application examples of strtotime in php:

Recommended tutorial: "PHP Tutorial"

The above is the detailed content of How to add one month to time in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn