mysql插入当前时间

now()函数以`yyyy-mm-dd hh:mm:ss返回当前的日期时间,可以直接存到datetime字段中。
curdate()以’yyyy-mm-dd’的格式返回今天的日期,可以直接存到date字段中。
curtime()以’hh:mm:ss’的格式返回当前的时间,可以直接存到time字段中。
例:
create table test_date(t_date date);
insert into test_date values(curdate());
mysql> select * from test_date;
+————+
| t_date |
+————+
| 2007-11-26 |
+————+

转自:http://qsrock.iteye.com/blog/143733

猜你喜欢

转载自blog.csdn.net/weixin_36343850/article/details/78740133