Hi Augusto,
This is a quick hack (nobody freak out please!) that will hopefully
explain this question and your other recent thread. Without further ado,
play with this :
<?php
$seconds = array ('day' => 60*60*24,
'week' => 60*60*24*7,
'month' => 60*60*24*30,
'year' => 60*60*24*365,
'decade' => 60*60*24*365*10);
testTime($seconds);
function testTime($times,$format='l dS of F Y h:i:s A')
{
echo 'Current time() : '. time();
echo '<h3>Future Times</h3><ul>';
foreach ($times as $type => $value) {
echo '<li>'. $type . ' : ' . date($format,time()+$value);
}
echo '</ul>';
echo '<h3>Past Times</h3><ul>';
foreach ($times as $type => $value) {
echo '<li>'. $type . ' : ' . date($format,time()-$value);
}
echo '</ul>';
}
?>
If it doesn't make sense, just say so. But essentially, timestamps are
very cool and important! Time() returns such a beast. It returns the
number of seconds since this date, we call it the EPOCH (*bows*) :
January 1 1970 00:00:00 GMT
Read about it here :
http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=epoch
Regards,
Philip Olson
http://www.cornado.com/
On Tue, 6 Mar 2001, Augusto Cesar Castoldi wrote:
> I'm trying to do a session with MySQL.
>
> how works the funtion time? I didn't undertood the manual.
>
> that number is a date, time, seconds?? What is it?
>
> regards,
>
> Augusto
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]