php - 添加超过 16 年的日期在 php 中显示错误
问题描述
我只是在 php 中检查添加年份。
当我尝试在当前日期添加超过 16 年时,它显示错误。
$a1 = "2021-04-25 14:54:21";
$expirydate = date('Y-m-d 23:59:59', strtotime($a1. "+16 Years")); // Less than 16 years working
echo $expirydate;
显示 2037-04-25 23:59:59这是正确的。
但
$a1 = "2021-04-25 14:54:21";
$expirydate = date('Y-m-d 23:59:59', strtotime($a1. "+17 Years")); // Adding More than 16 Years showing error
echo $expirydate;
显示1970-01-01 23:59:59
php有最大限制吗?
解决方案
推荐阅读
- javascript - 从 BASE 64 编码重新创建 Excel 文件
- r - 如何根据列数删除某些数据框?
- c# - C# GroupBy 生成平面标题详细信息列表
- c++ - 结构向量中自定义结构函数的内存使用
- sql - SQL 查询行需要从组总数中减少,直到值为零或新组
- javascript - Javascript if语句不执行代码
- azure - 无法在 Azure terraform 中执行“remote-exec”配置程序
- reactjs - 通过 localhost 在我的机器上部署 ReactJs 应用程序
- json - 如何读取这个本地 json 文件,并在 Adroid 上使用 Markers 获取地图上的坐标渲染?
- ruby-on-rails - 如何将 ApplicationMailer(或 ActionMailer)设置为默认使用 Activejob/sidekiq