Something like:
select date_format('unix-timestamp', yoursessiontimestampcolumn) from
sessiontable;
Then, you can just use time() and subtract to get the number of seconds, and
divide by 60 for the minutes.
Or, better yet, you can use MySQL functions to select sessions that are
old/new or whatever, and leave all the data calculations in MySQL.
http://mysql.org
http://mysql.com
Dunno (or care) which has better docs now that they've split. Sigh.
--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Augusto Cesar Castoldi <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Friday, August 03, 2001 9:21 AM
Subject: Minutes between tow dates
> Hi.
>
> I'm using the timestamp format (AAMMDDHHMMSS) on my session.
>
> how can I know the minutes between two dates.
>
> I'm doing:
>
> $date = $row_secao['date'];
> $date_now=date("ymdHis");
> $x=$date_atual-$date;
> if ($x > 1000) {
> echo "Session expired.";
> }
>
> but I have a problem when turns the hour, like this:
>
> date=010803105958
> date_now=010803110518
>
> the sub is 4500 (45 minutes!), but in fact, the real time between is 6
> minutes...
>
> thanks.
>
> 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]