在网站上显示上一个(过去)星期五的日期 [英] Display last (past) Friday date on website
本文介绍了在网站上显示上一个(过去)星期五的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我目前用来显示即将到来的星期五的日期.
This is what I currently use to display the date for this coming Friday.
$date_friday = date('F j', strtotime('Friday'));
print $date_friday;
我应该使用什么来显示过去(上一个)星期五的日期?
What should I use to display the date for the past (last) Friday?
推荐答案
这里是一个类似问题的答案(实际上是一样的,但针对星期二):如何在 php 中获取上周(星期二或任何其他日期)的日期?
Here is an answer to a similar question (actually the same but for tuesday) : how to get the date of last week's (tuesday or any other day) in php?
strtotime('last friday')
应该可以工作.
这篇关于在网站上显示上一个(过去)星期五的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文