C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
MySQL Date/Time timediff() FunctionThe timediff() is a MySQL date/time function. It is used to get the difference from given two time/datetime. Syntax
select timediff(time1, time2) Parameter:
time1, time2: time values to get the difference Returns:This function returns the difference between two time/datetime values. Example 1
select timediff('01:25:23','12:56:12');
Output:
Example 2
select timediff('2018-02-03 12:56:12','2018-10-03 01:25:23');
Output:
Next TopicMySQL datetime
|