一旦工作,那就要努力的干,聪明的干,快速的干——用省下来的时间干自己喜欢干的事情。!

php5 strtotime将字符串转换为时间戳时转换失败,返回false

php lampnick 6443℃ 0评论

代码如下:

<?php
var_dump(strtotime("2099-01-01 00:00:00"));
var_dump(strtotime("2069-01-01 00:00:00"));
var_dump(strtotime("2038-01-19 03:14:07"));
phpinfo();

运行结果如下图:

qq%e6%88%aa%e5%9b%be20170111104454

环境是64位的,很奇怪。

官方文档说明:

Note:

If the number of the year is specified in a two digit format, the values between 00-69 are mapped to 2000-2069 and 70-99 to 1970-1999. See the notes below for possible differences on 32bit systems (possible dates might end on 2038-01-19 03:14:07).官方说明32位系统最大处理时间为:2038-01-19 03:14:07,我的是64位系统,感觉很奇怪啊。。

转载请注明:MitNick » php5 strtotime将字符串转换为时间戳时转换失败,返回false

喜欢 (16)or分享 (0)
头像
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(2)个小伙伴在吐槽
  1. 头像
    后来是怎么解决的呢
    路雅2017-10-12 14:55 回复
    • 头像
      换成linux 64位就没问题了,windows版本的是存在问题的。
      lampnick2017-10-13 11:49 回复