周末日期退货问题
所以我有这个:
$start_date = date('Y-m-d',strtotime('Friday 17:00'));
$end_date = date('Y-m-d',strtotime("+2 days", strtotime('Friday')));
$conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
我想要输出下一个周末的日期(周五 1700 - 周日),直到我到达周五,然后它开始显示下一个周末。
我怎样才能让它显示当前周末直到周日结束,然后显示下一个周末?
So I have this:
$start_date = date('Y-m-d',strtotime('Friday 17:00'));
$end_date = date('Y-m-d',strtotime("+2 days", strtotime('Friday')));
$conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
I want the dates to output for the coming weekend (Fri at 1700 - Sun), which it does until I get to Friday, then it starts to show the next weekend.
How can I get it to show the current weekend until end of Sunday when it then shows the next weekend?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是strToTime 的相对日期的参考。
Here is the reference for strToTime's relative dates.