如何将db日期划分为几周?

时间:2016-08-27 02:20:00

标签: php mysql

我在数据库中有日期。例如,07/03/2016 (Sunday), 07/04/2016 (Monday)...

我已经计划使用while循环来浏览所有日期

while($fetch_content = mysqli_fetch_array($content)) {
...
}

现在,当我循环浏览这些日期时,如何将信息分成几周?

1 个答案:

答案 0 :(得分:0)

的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>