【整理】MySQL中的datetime与timestamp比较
来源:互联网 发布:大数据工程师年薪 编辑:程序博客网 时间:2024/05/17 12:19
参考: http://bjzhkuang.iteye.com/blog/1716617
相同点
列的显示格式相同,显示宽度固定在19字符,并且格式为YYYY-MM-DD HH:MM:SS。相同点
不同点
timestamp
1、4个字节储存(Time stamp value is stored in 4 bytes)
2、值以UTC格式保存( it stores the number of milliseconds)
3、时区转化 ,存储时对当前的时区进行转换,检索时再转换回当前的时区
4、支持的范围为"1970-01-02 00:00:00"到"2037-12-31 23:59:59";如果超过此范围,在进行数据库insert或者update时,会把一个年月日时分秒都是0的值放到表中,MySQL并不会报错,但程序可能报错
5、可以保存1秒以下的时间
datetime
1、8个字节储存(8 bytes storage)
2、实际格式储存(Just stores what you have stored and retrieves thesamething which you have stored.)
3、与时区无关(It has nothing to deal with the TIMEZONEandConversion.)
4、支持的范围为"1000-01-01 00:00:00"到"9999-12-31 23:59:59"
0 0
- 【整理】MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- 【转】MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- mysql中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp区别比较
- MySQL中的datetime与timestamp比较
- MySQL中的datetime与timestamp区别比较
- MySQL中的datetime与timestamp比较
- 百万级PHP网站架构工具箱
- 数据结构-二叉搜所树java实现
- 算法作业(第二周)
- YUM命令介绍
- 贝叶斯分类
- 【整理】MySQL中的datetime与timestamp比较
- JAVA解析XML格式字符串
- jQuery自定义插件
- 一个异常:ConstraintViolationException: validation failed for classes [] during persist time for groups
- Vim命令小结-指定词统计和提取指定词(正则表达式)
- java事务管理
- ie6 a标签背景图遮盖文字的解决办法
- scrapy缺省设置
- 外键列上是否需要索引