website page counter

Mysql Diff Date In Days

The best Images

Mysql Diff Date In Days. The following statement will return the days between two datetime expressions 2008 05 17 11 31 31 and 2008 04 28. The datediff function accepts two arguments that can be any valid date or date time values.

Mysql Cheat Sheet Web Programming Mysql Sql Cheat Sheet
Mysql Cheat Sheet Web Programming Mysql Sql Cheat Sheet from in.pinterest.com

The way it works is you provide two arguments one for each date and datediff will return the number of days between the two dates. The syntax of the mysql datediff function is as follows. In fact 365 doesn t take into consideration leap years and can lead to falsy results if you compare a date that has the same day month than the birthdate.

The following example illustrates how to use the datediff function to calculate the difference in hours between two datetime values.

Datediff 2008 05 17 11 31 31 2008 04 28 19 1 row. The mysql datediff function s default return value is the number of days between two date or datetime expressions. Select unix timestamp 2012 01 02 13 00 00 unix timestamp 2012 01 01 12 00 00 3600. Return the number of days between two date values.

close