Hi,
I'm just screwing around with the date() function and timestamps but have
run into a little logic problem...
So far (as you can see with the below posted code) I can manipulate
days,hours and minutes...any idea on how to do months and years?
Lastly the goal of this is to make take all the parameters and make 1
timestamp out of it...any ideas? or links?
The code is really easy to understand and was taken from the manual but have
commented it a bit none the less, so it should be real easy to understand
even without executeing it.

Thanks in advance.

Cheers,
-Ryan
P.S around 20 lines of simple code below, if testing code copy and name your
file t1.php.....

<html><head><title> Testing Dates</title></head>
<body><form type=get action=t1.php><input type=text name=m><input type=text
name=h><input type=text name=d><input type=submit></form></body></html>
<?php
## minutes ##
echo "<br>**MINUTES**<br>";
$minutes=$_GET['m'];if(!isset($_GET['m'])){$minutes=1;}
echo 'year - mo-da-hr-m - s : - : <b>$minutes</b> is set to
'.$minutes.'<br>';
echo date("Y-m-d-H-i-s")."&nbsp; &nbsp; Current<br>";
echo date("Y-m-d-H-i-s",(time() + $minutes*60));
## hours ##
echo "<br><br>**HOURS**<br>";
$hours=$_GET['h'];if(!isset($_GET['h'])){$hours=1;}
echo 'year - mo-da-hr-m: - : <b>$hours</b> is set to '.$hours.'<br>';
echo date("Y-m-d-H-i")."&nbsp; &nbsp; Current<br>";
echo date("Y-m-d-H-i",(time() + $hours*3600));
## days ##
echo "<br><br>**DAYS**<br>";
$days=$_GET['d'];if(!isset($_GET['d'])){$days=1;}
echo 'year - mo-da-hr-m : - : <b>$days</b> is set to '.$days.'<br>';
// $days=24*3600;
echo date("Y-m-d-H-i")."&nbsp; &nbsp; Current<br>";
echo date("Y-m-d-H-i",(time() + $days*(24*3600)));
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to