php获取当前月份,上一个月份,上两个月份,上三个月份
来源:互联网 发布:无法加载 windows 安装 编辑:程序博客网 时间:2024/05/16 19:40
$cur_month=(string)to_date(TIME_UTC,'Y-m');
// $last_one=to_date( to_timespan('-1 month'),'Y-m');
// $last_two=to_date( to_timespan('-2 month'),'Y-m');
// $last_three=to_date( to_timespan('-3 month'),'Y-m');
//切割出年份
$tmp_year=substr($cur_month,0,4);
//切割出月份
$tmp_mon =substr($cur_month,5,2);
$tmp_forwardmonth=mktime(0,0,0,$tmp_mon-1,1,$tmp_year);
$last_one=to_date($tmp_forwardmonth,"Y-m");
$tmp_forwardmonth=mktime(0,0,0,$tmp_mon-2,1,$tmp_year);
$last_two=to_date($tmp_forwardmonth,"Y-m");
$tmp_forwardmonth=mktime(0,0,0,$tmp_mon-3,1,$tmp_year);
$last_three=to_date($tmp_forwardmonth,"Y-m");
// $last_one=to_date( to_timespan('-1 month'),'Y-m');
// $last_two=to_date( to_timespan('-2 month'),'Y-m');
// $last_three=to_date( to_timespan('-3 month'),'Y-m');
//切割出年份
$tmp_year=substr($cur_month,0,4);
//切割出月份
$tmp_mon =substr($cur_month,5,2);
$tmp_forwardmonth=mktime(0,0,0,$tmp_mon-1,1,$tmp_year);
$last_one=to_date($tmp_forwardmonth,"Y-m");
$tmp_forwardmonth=mktime(0,0,0,$tmp_mon-2,1,$tmp_year);
$last_two=to_date($tmp_forwardmonth,"Y-m");
$tmp_forwardmonth=mktime(0,0,0,$tmp_mon-3,1,$tmp_year);
$last_three=to_date($tmp_forwardmonth,"Y-m");
0 0
- php获取当前月份,上一个月份,上两个月份,上三个月份
- iOS获取当前月份的上一个月份
- 月份
- 月份
- 月份
- php获取月份差
- PHP获取当前月份,多种显示方法
- Java 返回上一个月份
- java利用当前时间,得到上一个月份
- js获取当前月份方法
- js获取当前月份天数
- 获取当前年份、月份、日期
- 获取当前月份日期与上个月份日期
- php 获取月份的天数
- php 时间月份的获取
- php获取当前月份的第一天与最后一天
- 当前月份日历
- php 获取指定两个时间之间相差的月份
- replace(/^[^\?]+\?/, '');的含义
- 第三方库列表总结(待补充。。。)
- 5.布局指令
- Android打造listview万能适配器(上)
- 在这些科技巨头的带领下,开源软件今年开启了第二春
- php获取当前月份,上一个月份,上两个月份,上三个月份
- C++ 学习路线和看法
- Linux下MySQL日志的管理
- Android添加phonegap--sencha touch2插件教程
- java 获取随机数
- 谱聚类算法(Spectral Clustering)
- 使用VNC远程不能输入字符问题
- HDU 1299 Diophantus of Alexandria(数论)
- poj1363 Rails--栈基础应用