Re: determining time difference between two timestamp fields.

From: Date: Tue, 25 May 2010 19:54:50 +0000
Subject: Re: determining time difference between two timestamp fields.
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.general 
Request: Send a blank email to php-general+get-305524@lists.php.net to get a copy of this message
On 25 May 2010 21:50, Bruce Gilbert <webguync@gmail.com> wrote: > yea, not sure why my Query isn't returning a value though? If I don't > use date(), what should I use? The output of strtotime() is an int - specifically a number of seconds. Subtract two number of seconds from each other and what do you get? Furthermore, divide by 60 and what do you get? Should you want to format this, you can consider sprintf(), though, if you just want a whole number of minutes, just use floor(). > the SQL for the timestamps looks like this. > login_timestamp datetime NOT NULL default '0000-00-00 > 00:00:00', > submit_timestamp timestamp NOT NULL default CURRENT_TIMESTAMP, Try just selecting all values from your database, to see what's actually in there. > sorry for the top-posting, but I think you have to in gmail. No you don't, that's ridiculous. -- <hype> WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind BeWelcome/Couchsurfing: Fake51 Twitter: http://twitter.com/kafe15 </hype>

« previous php.general (#305524) next »