php strtotime 用法只细节
来源:互联网 发布:操作系统书籍推荐 知乎 编辑:程序博客网 时间:2024/06/05 15:49
最近写代码是发现一个bug 。
一般为了方便查询 ,把数据库时间保存成时间戳,数据库中用int类型,有时候还加上unsigned限制,如果时间是1970 00:00:00 之前,而且还使用strtotime 转化,
会出现bug.
例如:
$time='1967-09-10';//在1970 00:00:00之前
$time=strtotime($time);
此时的$time是个负数,如果数据库中int 还有unsigned限制的话,那么$time在数据库中保存不了始终为0.
小细节 ,切记!
0 0
- php strtotime 用法只细节
- PHP中strtotime函数用法
- strtotime 用法
- PHP----->strtotime()
- php strtotime()
- PHP----->strtotime()
- php strtotime函数和date函数用法
- PHP函数strtotime详解
- PHP函数strtotime详解
- php函数 strtotime
- PHP strtotime函数详解
- PHP strtotime() 函数
- php strtotime 周计算
- PHP strtotime函数详解
- PHP strtotime()函数
- PHP strtotime 性能问题
- PHP strtotime() 函数
- php strtotime()处理时间
- iptables开放端口的使用方法总结
- mysql 数据库引擎修改
- ns3 常用优化技术
- stagefright概述
- EL表达式 三目运算符在不同版本Tomcat中的表现
- php strtotime 用法只细节
- MT 6572 平台手机系统源码分析
- cocos2d-x 碰撞
- shell脚本中的算术运算
- (android高仿系列)今日头条 --新闻阅读器 (三) 完结 、总结 篇
- Linux下的du命令
- Unity 2D游戏开发快速入门(内部资料)
- QQ通信原理及如何穿内网进行通信
- spring framework下载地址