Posted By

pruntrut on 06/04/12


Tagged

phptime


Versions (?)

How to add days, weeks, months to any date


 / Published in: PHP
 

URL: http://www.vision.to/how-to-add-days-weeks-months-to-any-date-.php

How to add days, weeks, months to any date

  1. $date = date("Y-m-d");// current date
  2.  
  3. $date = strtotime(date("Y-m-d", strtotime($date)) . " +1 day");
  4. $date = strtotime(date("Y-m-d", strtotime($date)) . " +1 week");
  5. $date = strtotime(date("Y-m-d", strtotime($date)) . " +2 week");
  6. $date = strtotime(date("Y-m-d", strtotime($date)) . " +1 month");
  7. $date = strtotime(date("Y-m-d", strtotime($date)) . " +30 days");

Report this snippet  

You need to login to post a comment.