# ISO周日历

ISO周日历系统是ISO 8601日期和时间标准的一部分，是一种闰周历系统。这个系统主要用在政府商务会计年度，用以维持时序。这个系统依据格里历的年度中特定的一个周日，决定该年是否要增加一个星期。

2020年6月

## 与格里历关系

Vulgar ISO

### 第一周

ISO 8601定义包含当年第一个星期四的那一周是第一个星期。 基于这个定义，下列的属性有相互的等价性：

• 第一周至少有4天在1月里面。
• 该年的“第一天”是最靠近该年1月1日的星期一。
• 第一个星期最早是12月29日至1月4日，最晚是1月4日至1月10日。
• 如果1月1日和星期六与星期日不是工作日，1月4日就会是第一个工作日。

### 最后一周

ISO周日历的最后一星期是第52周或53周，是下一年的第一周之前。这一周的特质如下：

• 格里历的最后一个星期四会在这一周内。
• 最后一周有至少有4天在12月里面。
• 它的中间日，星期四，一定在年尾。
• 最接近格里历年结束的是12月31日星期日。
• 12月28日一定在年度内。因为最后一周的日期最晚是12月28日至1月3日，最早是12月22日至12月28日。

### 每年的星期

28 56 84 96 124 004 009 015 020 026 032 037 043 048 054 060 065 071 076 082 088 093 099 105 111 116 122 128 133 139 144 150 156 161 167 172 178 184 189 195 201 207 212 218 224 229 235 240 246 252 257 263 268 274 280 285 291 296 303 308 314 320 325 331 336 342 348 353 359 364 370 376 381 387 392 398

ISO的常年有43次间隔6年，27次间隔5年，有一次间隔7年（从296年到303年）。

• 有70个闰年（对应的儒略历年也都是闰年），和
• 259个平年（但是儒略历有3年是闰年：100、200、和300）。

• 27个ISO周日历的长年（53周或371天）比对应的格里历闰年（366天）多5天。
• 44个ISO周日历的长年（53周或371天）比对应的格里历平年（365天）多6天。
• 70个ISO周日历的短年（52周或364天）比对应的格里历闰年（366天）少2天。
• 259个ISO周日历的短年（52周或364天）比对应的格里历平年（365天）少1天。

### 每个月的星期

ISO的标准并未定义任何周与月相关联的协定。月中的每一天和月，也都以周和周日表达，且不会混淆不清。

### 固定周数的日期

01月 04 11 18 25 01–04
02月 01 08 15 22 05–08
03月 01 08 15 22 29 09–13
04月 05 12 19 26 14–17
05月 03 10 17 24 31 18–22
06月 07 14 21 28 23–26
07月 05 12 19 26 27–30
08月 02 09 16 23 30 31–35
09月 06 13 20 27 36–39
10月 04 11 18 25 40–43
11月 01 08 15 22 29 44–48
12月 06 13 20 27 49–52

### Equal weeks

 第6周 第10周 第45周 第7周 第11周 第46周 第8周 05 06 07 08 09 10 11 05 06 07 08 09 10 11 05 06 07 08 09 10 11 12 13 14 15 16 17 18 12 13 14 15 16 17 18 12 13 14 15 16 17 18 19 20 21 22 23 24 25 19 20 21 22 23 24 25 19 20 21 22 23 24 25

The pairs 02/41, 03/42, 04/43, 05/44, 15/28, 16/29, 37/50, 38/51 and triplets 06/10/45, 07/11/46, 08/12/47 have the same days of the month in common years. Of these, the pairs 10/45, 11/46, 12/47, 15/28, 16/29, 37/50 and 38/51 share their days also in leap years. Leap years also have triplets 03/15/28, 04/16/29 and pairs 06/32, 07/33, 08/34.

The weeks 09, 19–26, 31 and 35 never share their days of the month with any other week of the same year.

## 优点

• All weeks have an integral number of days (i.e. there are no fractional weeks).
• All years have an integral number of weeks.
• The date directly tells the weekday.
• All week-numbering years start with a Monday and end with a Sunday.
• When used by itself without using the concept of month, all week-numbering years are the same except that some years have a week 53 at the end.
• The weeks are the same as used with the Gregorian calendar.

## 缺点

The year number of the ISO week very often differs from the Gregorian year number for dates close to 1 January. For example, 29 December 2014 is ISO 2015-W1-1, i.e., it is in year 2015 instead of 2014. A programming bug confusing these two year numbers is probably the cause of some Android users of Twitter unable to login around midnight of 29 December 2014 UTC. [1]

Solar astronomic phenomena, such as equinox and solstice, vary over a range of at least seven days. This is because each equinox and solstice may occur any day of the week and hence on at least seven different ISO week dates. For example, there are spring equinoxes on 2004-W12-7 and 2010-W11-7.

The ISO week calendar relies on the Gregorian calendar, which it augments, to define the new year day (Monday of week 01). As a result, leap weeks are spread across the 400-year cycle in a complex, seemingly random pattern. There is no simple algorithm to determine whether a year has 53 weeks without tabular lookup. Most calendar reform proposals using leap week calendars are simpler in this regard, although they may choose a different leap cycle.

Not all parts of the world have a work week that begins with Monday. For example, in some Muslim countries, the work week may begin on Saturday, while in Israel it may begin on Sunday. In the US the work week is often defined to start on Monday, although the week itself is usually considered to start on Sunday.

## 转换

 周数 日期 主日字母星期表 年的前2位数 mod 4 年的后2位数 mod 28 0108152229 0209162330 0310172431 04111825-- 05121926-- 06132027-- 07142128-- 01–04 40–43 01月 10月 A B C D E F G 00 06 12 17 23 14–17 27–30 04月 07月 G A B C D E F 01 07 12 18 24 36–39 49–52 09月 12月 F G A B C D E 02 08 13 19 24 23–26 06月 E F G A B C D 03 08 14 20 25 05–08 09–13 44–48 02月 03月 11月 D E F G A B C 04 09 15 20 26 31–35 08月 C D E F G A B 04 10 16 21 27 18–22 05月 B C D E F G A 05 11 16 22 00 200016 210117 220218 230319

c = 20，y = 32 mod 28 = 4，d = 1，m = 10；
DL = (2004/04) = DC，dl = (1，10) = A，D = (4，10)(40 + 1)；
C = 周日，A = 周五，D = 周一(41)；
n = 41 - 1 = 40，w = 5；
WD = 2032–W40–5。

c = 19，y = 80 mod 28 = 24，n = 40，w = 1 = 周一；
DL = (19，24/24) = FE，D = (4，10)；
E = 周日，D = 周六(40)，F = (6，10)周一(41) = (-1，10)(29，9)周一(40)；
CD = 1980年9月29日周一。

### 计算给定日期的周数

The week number of any date can be calculated, given its ordinal date (i.e. position within the year) and its day of the week. If the ordinal date is not known, it can be computed by any of several methods; perhaps the most direct is a table such as the following.

 To the day of: Add: For leap years: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 0 31 59 90 120 151 181 212 243 273 304 334 0 31 60 91 121 152 182 213 244 274 305 335

Method: Using ISO weekday numbers (running from 1 for Monday to 7 for Sunday), subtract the weekday from the ordinal date, then add 10. Divide the result by 7. Ignore the remainder; the quotient equals the week number. If the week number thus obtained equals 0, it means that the given date belongs to the preceding (week-based) year. If a week number of 53 is obtained, one must check that the date is not actually in week 1 of the following year.

${\displaystyle week(date)=\left\lfloor {\frac {ordinal(date)-weekday(date)+10}{7}}\right\rfloor }$
${\displaystyle if\,week<1\,then\,week=lastWeek(year-1)}$
${\displaystyle if\,week>lastWeek(year)\,then\,week=1}$

Example: Friday 26 September 2008

• Ordinal day: 244 + 26 = 270
• Weekday: Friday = 5
• 270 − 5 + 10 = 275
• 275 / 7 = 39.28…
• Result: Week 39

### 计算给定年、周数和周日的日期

This method requires that one know the weekday of 4 January of the year in question.[注 1] Add 3 to the number of this weekday, giving a correction to be used for dates within this year.

Method: Multiply the week number by 7, then add the weekday. From this sum subtract the correction for the year. The result is the ordinal date, which can be converted into a calendar date using the table in the preceding section. If the ordinal date thus obtained is zero or negative, the date belongs to the previous calendar year; if greater than the number of days in the year, to the following year.

${\displaystyle ordinal(date)=week(date)\times 7+weekday(date)-(weekday(year(date),1,4)+3)}$
${\displaystyle if\,ordinal<1\,then\,ordinal=ordinal+daysInYear(year-1)}$
${\displaystyle if\,ordinal>daysInYear(year)\,then\,ordinal=ordinal-daysInYear(year)}$

Example: year 2008, week 39, Saturday (day 6)

• Correction for 2008: 5 + 3 = 8
• (39 × 7) + 6 = 279
• 279 − 8 = 271
• Ordinal day 271 of a leap year is day 271 − 244 = 27 September
• Result: 27 September 2008

## 其他的周数系统

For an overview of week numbering systems see week number.

The US system has weeks from Sunday through Saturday, and partial weeks at the beginning and the end of the year, i.e. always 53 weeks. An advantage is that no separate year numbering like the ISO year is needed. Correspondence of lexicographical order and chronological order is preserved (just like with the ISO year-week-weekday numbering), but partial weeks make some computations of weekly statistics or payments inaccurate at end of December or beginning of January.

A variant of this US scheme groups the possible 1 to 6 days of December remaining in the last week of the Gregorian year within week 1 in January of the next Gregorian year, to make it a full week, bringing a system with accounting years having also 52 or 53 weeks and only the last 6 days of December may be counted as part of another year than the Gregorian year.

The US broadcast calendar counts the week containing 1 January as the first of the year, but otherwise works like ISO week numbering without partial weeks.

## 注解

1. ^ Either see calculating the day of the week, or use this quick-and-dirty method: Subtract 1965 from the year. To this difference add one-quarter of itself, dropping any fractions. Divide this result by 7, discarding the quotient and keeping the remainder. Add 1 to this remainder, giving the weekday number of 4 January. Do not use for years past 2100.