Re: determining time difference between two timestamp fields.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25 May 2010 21:50, Bruce Gilbert <webguync@xxxxxxxxx> 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>

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux