PHP implements date addition and subtraction

不言
Release: 2023-03-25 09:18:02
Original
3661 people have browsed it

The content of this article is about the addition and subtraction of dates in PHP. It has a certain reference value. Now I share it with you. Friends in need can refer to it.

Function name: strtotime("time" );

Example:

Add 1 day: strtotime(" 1day")

Add 1 month: strtotime(" 1month")

Add One year: strtotime("1year")

Minus 1 day: strtotime("-1day")

Minus 1 month: strtotime("-1month")

Subtract one year: strtotime("-1year")



The above is the detailed content of PHP implements date addition and subtraction. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template