开发者

If condition with date interval and dynamic year

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜