开发者

If condition with date interval and dynamic year

开发者 https://www.devze.com 2023-01-29 20:50 出处:网络
I need a little help about a \"if\" condition in a specific period od the year. Cause I want to this once time forever the year myst be dynamic.

I need a little help about a "if" condition in a specific period od the year. Cause I want to this once time forever the year myst be dynamic. It will be like:

if (1 December of current year < $today > 8 january of next year)

I don't know how to d开发者_如何转开发o date's math for having the year that dynamically changes!


if (strtotime("1 December") < time() > strtotime("8 January next year"))


@Kreker, my good man, use Or instead of And:

if ((strtotime("1 December") < time()) || (time() < (strtotime("8 January"))))
{
    echo "Yip!";
} 
0

精彩评论

暂无评论...
验证码 换一张
取 消