获取下个月的第一天 [英] Get 1st day of next month

查看:116
本文介绍了获取下个月的第一天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

如何查找下个月的第一天并使用php到该日期为止还剩下几天

我有这个方法来获取本月的第一天

I have this to get 1st day of current month

$_SERVER['dataInicio'] = date('Y') . "-" . date('m') . "-" . "1";

我需要类似的东西才能获得下一个月的第一天

I need something similar to get 1st day of NEXT month

推荐答案

对于下个月,这似乎是重复的内容或类似的帖子

This seems like a duplicate or similar post to this for the next month

但对于下个月的内容如果您想使用strtotime,请像这样

but for the next month something like this if you want to use strtotime

date("m/l/Y", strtotime(date('m', strtotime('+1 month')).'/01/'.date('Y').' 00:00:00'));

这将返回

12 /周六/ 2012,如果您只希望将日期名称设置为l(小写L),则将日期格式设置为l(小写L)

12/Saturday/2012 if you want just the days name just set the date format to l (lower case L)

date( l,strtotime( date('m',strtotime('+ 1 month'))。'/ 01 /'。date('Y')。'00:00:00'));

如何使用PHP查找下个月的第一天以及到该日期为止的剩余天数

在PHP中,是否有一种简单的方法来获取一个月的第一个和最后一个日期?

这篇关于获取下个月的第一天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆