java - Subtracting of Time in My Sql (Hours) -


please me. need subtract login time , logout time. need hours answer. sql syntax this? thank in advance.

you want combination of timediff

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timediff

mysql> select timediff('2008-12-31 23:59:59.000001',     ->                 '2008-12-30 01:01:01.000002');         -> '46:58:57.999999' 

and hour

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_hour

mysql> select hour('10:05:03');         -> 10 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -