Home Sql Sqldate Mysql Time Difference Function
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

Mysql Time Difference Function

Advertisement
Mysql Time Difference Function is used to find the time difference between any two dates.

Mysql Time Difference Function

     

Mysql Time Difference Function is used to find the time difference between any two dates.

Understand with Example

The Tutorial describe an example that helps you to understand 'Mysql Time Difference  Function'. In this example we use TimeDiff('Year1 Time1', 'Year2 Time2') query that return you the time difference between any two consecutive dates.

TimeDiff('Year1 Time1', 'Year2 Time2') : The Query performs the time difference between any consecutive dates.

 

 

Query to Time Difference Function

mysql> SELECT TIMEDIFF('2009:01:08 00:00:00', '2008:01:01 00:00:00.000001');
+---------------------------------------------------------------+
| TIMEDIFF('2009:01:08 00:00:00', '2008:01:01 00:00:00.000001') |
+---------------------------------------------------------------+
| 8951:59:59.999999 |
+---------------------------------------------------------------+
1 row in set (0.00 sec)
Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 21, 2009

Related Tutorials

Ask Questions?    Discuss: Mysql Time Difference Function  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
Navdeep Khandelwal
May 31, 2013
Login/Logout System

I am making a project of employee attandance ,which will run on one pc.when employees come/goes they login/logout into that system and we storing login/logout time .But I have a problem when a user Re-login into that system for same date a new row is created into database,but i want to prevent a user if he re-login in the system.I am using only jsp.Can you help me?
DMCA.com