Computers & ProgrammingBackend DevelopmentSQL

MySQL DATEDIFF Function

The MySQL DATEDIFF function returns the difference in time between two dates.

Syntax

DATEDIFF(dateA, dateB)

Example

SELECT DATEDIFF('2011-12-31','2011-12-30') AS [Date Difference]

Results

1

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top