note 14429 added to ref.datetime.php

From: Date: Tue, 31 Jul 2001 10:07:11 +0000
Subject: note 14429 added to ref.datetime.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16092@lists.php.net to get a copy of this message
In addition to franck@gerbille.net's example. I needed a quick simple function that added 30 days to a date for a PHP Site running 3.0.7. I came up with, // ----------------------------- // -- Add thirty days -- // ----------------------------- $timenow = time(); $plusthirtydays = date("d-m-Y", $timenow + 2592000); // ----------------------------- $plusthirtydays now contains your date, 30 days later than current. You can change the timestamp if you wish to increase the number of days etc. And you can select whether to add or subtract. Alternatively, I believe strtotime() is a good function to do this job, available in 3.0.12 Its not much, but I like it :), Amadiere http://www.php.net/manual/en/ref.datetime.php

« previous php.notes (#16092) next »