Adding And Subtracting Dates

Here’s how you add and subtract dates from one another. For example, this simple code can calculate what the date will be 2 weeks before or after 1998-08-14 (yyyy-mm-dd). Subtracting days from a date The following example will subtract 3 days from 1998-08-14. The result will be 1998-08-11. $date = “1998-08-14″; $newdate = strtotime ( ‘-3 day’ , strtotime ( $date ) ) ; $newdate = date (...

Read More