gpt4 book ai didi

php - 为什么 strtotime ('a' ) 返回时间?

转载 作者:可可西里 更新时间:2023-10-31 22:14:50 25 4
gpt4 key购买 nike

我在 PHP 5.3 中遍历 CSV 文件并检查日期。我一直在使用 strtotime(),它运行良好,除了我拥有的一个包含 1 个或 2 个字符代码的字段。

任何单个字符代码上的 strtotime() 似乎都像我要求的 now(),但如果代码是 2 个字符,它就会失败,正如我所期望的那样。

我对 strtotime() 的工作方式有什么不了解?

最佳答案

看看http://www.php.net/manual/en/datetime.formats.time.php时间格式。似乎'a'是一个时区。 “a”起作用并且正在解决其他问题可能只是一个错误,但至少这是解释。

关于php - 为什么 strtotime ('a' ) 返回时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7920200/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com