Learning PHP and MySQL
Example 11-17 Adding two days to the date
<?php
$timestamp= time();
echo date("m/d/y G.i:s",$timestamp);
$seconds=2*24*60*60;
$timestamp+=$seconds;
echo "<br>new dates is:";
echo date("m/d/y G.i:s",$timestamp);
?>
This outputs:
12/13/05 16.28:32
new dates is:12/15/05 16.28:32
Posted by on 08/18 at 06:02 PM
Next entry: Example 11-18 Validating two dates
Previous entry: Example 11-16 Making the date and time appear like we expect