Javatpoint Logo
Javatpoint Logo

MySQL DATEDIFF() Function

The datediff() is a MySQL date/time function. It is used to get the difference between two date values.

Syntax

Parameter:

date1 & date2 : date's for calculating the difference.

Returns

This function returns the difference in days between two date values.

Example 1

Output:


MySQL DATEDIFF() Function

Example 2

Output:


MySQL DATEDIFF() Function
Next TopicMySQL date/time




Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA