MySQL Tutorial/Date Time Functions/TO DAYS — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 13:44, 26 мая 2010
Deal with two-digit-year value
mysql>
mysql> SELECT TO_DAYS("1997-10-07"), TO_DAYS("97-10-07");
+-----------------------+---------------------+
| TO_DAYS("1997-10-07") | TO_DAYS("97-10-07") |
+-----------------------+---------------------+
| 729669 | 729669 |
+-----------------------+---------------------+
1 row in set (0.00 sec)
mysql>
SELECT TO_DAYS("1997-10-07");
mysql>
mysql> SELECT TO_DAYS("1997-10-07");
+-----------------------+
| TO_DAYS("1997-10-07") |
+-----------------------+
| 729669 |
+-----------------------+
1 row in set (0.00 sec)
mysql>
TO_DAYS(date) returns a day number (the number of days since year 0).
mysql>
mysql> SELECT TO_DAYS(950501);
+-----------------+
| TO_DAYS(950501) |
+-----------------+
| 728779 |
+-----------------+
1 row in set (0.00 sec)
mysql>