Posted By

ginoplusio on 11/08/08


Tagged

date strtotime


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

not_skeletor
VaiT
dviero
joethermal


Add days to a date


 / Published in: PHP
 

URL: http://www.barattalo.it

  1. function dayadd($g,$dayYmd) {
  2. //add $g days to $dayYmd (date is in YYYY-MM-DD format)
  3. $d = strtotime($dayYmd);
  4. $cc = 24*60*60*$g + 60*60 + $d;
  5. return date("Y-m-d",$cc);
  6. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Scooter on November 8, 2008

$cc = strtotime($dayYmd . " +" . $g . " days");

You need to login to post a comment.