Jump to: navigation, search

Mysql TO DAYS

From w3cyberlearnings

Contents

MySQL TO_DAYS Function

This function returns the total day from the date expression. According to the dev.mysql.com, this function is not intended for use with value that precede the advent of the Gregorian Calendar (1582). In addition, for the date before 1582 results from this function are not reliable.

Syntax TO_DAYS

  • expre: date or datetime expression
TO_DAYS(expre);

Example 1

mysql> SELECT TO_DAYS('2012-04-04');
+-----------------------+
| TO_DAYS('2012-04-04') |
+-----------------------+
|                734962 |
+-----------------------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT TO_DAYS('00-01-01');
+---------------------+
| TO_DAYS('00-01-01') |
+---------------------+
|              730485 |
+---------------------+
1 row in set (0.00 sec)


Related Links



Navigation
Web
SQL
MISC
References