【发布时间】:2012-08-01 02:22:01
【问题描述】:
MySQL 的WEEK() 函数在什么模式下产生ISO 8601 week of the year? WEEK() 的参数 2 根据此图表设置模式:
+--------------------------------------------------------------------+
| Mode | First day of week | Range | Week 1 is the first week ... |
|------+-------------------+-------+---------------------------------|
| 0 | Sunday | 0-53 | with a Sunday in this year |
|------+-------------------+-------+---------------------------------|
| 1 | Monday | 0-53 | with more than 3 days this year |
|------+-------------------+-------+---------------------------------|
| 2 | Sunday | 1-53 | with a Sunday in this year |
|------+-------------------+-------+---------------------------------|
| 3 | Monday | 1-53 | with more than 3 days this year |
|------+-------------------+-------+---------------------------------|
| 4 | Sunday | 0-53 | with more than 3 days this year |
|------+-------------------+-------+---------------------------------|
| 5 | Monday | 0-53 | with a Monday in this year |
|------+-------------------+-------+---------------------------------|
| 6 | Sunday | 1-53 | with more than 3 days this year |
|------+-------------------+-------+---------------------------------|
| 7 | Monday | 1-53 | with a Monday in this year |
+--------------------------------------------------------------------+
这些模式中的一种是否会提供一年中的 ISO 8601 周?
【问题讨论】:
-
+1 便于搜索(我用谷歌搜索了“mysql week ISO-8601”,这个问题是第一个结果)