MySQL Tutorial/Date Time Functions/TIMESTAMP — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 09:50, 26 мая 2010
TIMESTAMP(expr1,expr2) adds the time expression expr2 to the date or datetime expression expr1 and returns the result as a datetime value.
mysql>
mysql>
mysql> SELECT TIMESTAMP("2003-12-31 12:00:00","12:00:00");
+---------------------------------------------+
| TIMESTAMP("2003-12-31 12:00:00","12:00:00") |
+---------------------------------------------+
| 2004-01-01 00:00:00 |
+---------------------------------------------+
1 row in set (0.00 sec)
mysql>
TIMESTAMP(expr) returns the date or datetime expression expr as a datetime value
mysql>
mysql> SELECT TIMESTAMP("2003-12-31");
+-------------------------+
| TIMESTAMP("2003-12-31") |
+-------------------------+
| 2003-12-31 00:00:00 |
+-------------------------+
1 row in set (0.00 sec)
mysql>