获取当前月份和当前年份直到今天的天数
问题描述:
如何获取当前月份已经过去的天数和当前年份已经过去的天数,例如今天是4月6日。
我应该得到当前月份的6天和
我应该在本年度获得97
How To get the number of days that have already passed from the current month and the number of days that have already passed from the current year eg if today is April 6. I should be getting 6 for current month and I should be getting 97 for current year
有没有办法让我得到除周日以外的其他东西
Is there a way I can get the same excluding SUNDAYS
答
看看php date()
函数。在您的情况97中,它具有参数'z'
,这是一年中的一天:
Take a look at the php date()
function. It has a parameter 'z'
, which is the day of the year, in your situation 97:
echo date('z');
与每月的同一天:
echo date('j');