Date、DateTime、TimeStamp的范围

来源:互联网 发布:linux 流媒体服务器 编辑:程序博客网 时间:2024/05/19 17:05
1、Date
格式为YYYY-MM-DD
范围: 1000-01-01 至 9999-12-31


2、DateTime
格式为YYYY-MM-DD HH:MM:SS
范围:1000-01-01 00:00:00 至 9999-12-31 23:59:59


3、TimeStamp
格式为YYYY-MM-DD HH:MM:SS
范围:1970-01-01 00:00:00 至 2037-12-31 23:59:59


4、MySQL获取时间的一些方法:(可以放在insert语句中用)

select now(): 2015-08-01 11:39:42
select curtime():11:39:42
select curdate():2015-08-01
select current_time:11:39:42
select current_date:2015-08-01

select current_timestamp:2015-08-01 11:39:42


未完,未来还会有补充。

新人发博客,如有错,还望指正。

0 0
原创粉丝点击