您好,欢迎访问一九零五行业门户网

mysql now() Incorrect datetime value for column_MySQL

bitscn.com
mysql> select now(); select now() -10;
+---------------------+
| now()               |
+---------------------+
| 2009-09-25 21:07:20 |
+---------------------+
1 row in set (0.00 sec)
+-----------------------+
| now() -10             |
+-----------------------+
| 20090925210710.000000 |
+-----------------------+
1 row in set (0.00 sec)
sometime it works, but sometime doesnt for
mysql now() incorrect datetime value for column
there's an insidious problem doing simple maths using now() ... subtraction of seconds and minutes etc are based on 100 seconds in a minute, and 100 minutes in an hour ...
so, you need to be do something more like:
select now(); select now() -interval 10 second;
and that's how to solver the problem.
bitscn.com
其它类似信息

推荐信息