A clean way is to use strtotime()
$date = strtotime("+1 day", strtotime("2007-02-28"));
echo date("Y-m-d", $date);
Will give you the 2007-03-01
More Related Contents:
- PHP 01/01/1970 Issues with Date Fields
- PHP, Get tomorrows date from date
- Determine If Business Is Open/Closed Based On Business Hours
- Display which day it is? sunday or monday “php coding”? [closed]
- Php date() Date and time is stuck [closed]
- Compare given date with today
- PHP DateTime::modify adding and subtracting months
- Add ‘x’ number of hours to date
- How to list all months between two dates
- How can I check if the current date/time is past a set date/time?
- Find Month difference in php? [duplicate]
- How to generate random date between two dates using php?
- PHP date() and strtotime() return wrong months on 31st
- How to get previous month and year relative to today, using strtotime and date?
- Set timezone in PHP and MySQL
- How to get closest date compared to an array of dates in PHP
- Adding three months to a date in PHP
- Calculate total seconds in PHP DateInterval
- php strtotime “last monday” if today is monday?
- How do I find the hour difference between two dates in PHP?
- mysql – INSERT date range into date columns IF dates don’t overlap with existing ones
- How do you explain the result for a new \DateTime(‘0000-00-00 00:00:00’)?
- php – add two hours to date variable
- PHP: How to check if a date is today, yesterday or tomorrow
- Get a PHP DateTime difference in days, considering midnight as a day change
- date() method, “A non well formed numeric value encountered” does not want to format a date passed in $_POST
- Converting to date in PHP from yyyymmdd format
- Subtracting a certain number of hours, days, months or years from date
- Getting first weekday in a month with strtotime
- How do I convert an ISO8601 date to another format in PHP?