Home >Backend Development >PHP Problem >How to add days to the current time in php
How to increase the number of days in php: 1. Add one day to the current time through the "date('Y-m-d',strtotime(" 1 day"))" method; 2. Use "strtotime(" 1 month The ")" method adds one month to the current time.
Recommended: "PHP Video Tutorial"
How to add days and months in php
Add one day to the current time: echo date('Y-m-d',strtotime(" 1 day"))
Add one month to the current time: strtotime(" 1 month")
The current time is increased by one year: strtotime(" 1 year")
The current time is increased by one second: strtotime(" 1 seconds")
The existing time is increased by one day :
$d='2012-10-11'; eccho date('Y-m-d',strtotime("{$d} +1 day"));
More are
echo strtotime( 'yesterday ') echo date( "Ymd ",strtotime( 'last week '));
The above is the detailed content of How to add days to the current time in php. For more information, please follow other related articles on the PHP Chinese website!