codeigniter - 试图从日期中删除 1 个月
问题描述
我在看别人的代码。基本上,该代码旨在提取本月的数据和前几个月的数据。
今天,它显示 7 月为当前月份,7 月为上个月。我怀疑是因为今天是 7 月 31 日,而不是 6 月 31 日。
下面是定义上个月的代码 - 有什么想法吗?
$this->monthPrev = date('F Y', strtotime('this month -1 month'));
$this->currentMonth = date('F Y', strtotime('this month'));
解决方案
推荐阅读
- c# - Textbox.Text 重新排列字符串内容
- php - 将接口传递给另一个接口方法
- sql - 检查元组是否在每个子查询结果中(Oracle SQL)
- angular - 如何使用 ngFor Angular 动态创建许多模式?
- python - 如何在 IDE 编辑器 PyCharm 中运行 abaqus python 脚本
- c# - 起订量持久函数 IDurableOrchestrationContext 时设置 CallActivityAsync 始终返回 null
- javascript - Invariant Violation:对象作为 React 子对象无效(在 json 中使用 react-native 对象)
- java - 消除非显着排列
- bots - discordjs 只从特定频道读取消息
- python-3.x - 如何循环浏览 DynamoDB 表中的项目?