本文介绍了如何将数据库日期划分为周?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在数据库中有日期.例如,07/03/2016(星期日)、07/04/2016(星期一)...
I have dates in a db. For example, 07/03/2016 (Sunday), 07/04/2016 (Monday)...
我已经计划使用 while 循环遍历所有日期
I'm already planning on using a while loop to go through all the dates with
while($fetch_content = mysqli_fetch_array($content)) {
...
}
现在,当我遍历这些日期时,如何将信息划分为周?
Now, when I loop through these dates, how can I divide the information into weeks?
推荐答案
JavaScript
<script type="text/javascript">
var d=new Date()
var weekday=new Array(7)
weekday[0]="Sunday"
weekday[1]="Monday"
weekday[2]="Tuesday"
weekday[3]="Wednesday"
weekday[4]="Thursday"
weekday[5]="Friday"
weekday[6]="Saturday"
document.write("Today it is " + weekday[d.getDay()])
</script>
这篇关于如何将数据库日期划分为周?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!