1
txx 2014-12-29 17:01:17 +08:00
我还以为我被认证了...
|
2
Jelen 2014-12-29 17:11:21 +08:00
区别是什么,我还是不理解
|
4
clino 2014-12-29 17:23:13 +08:00
```
Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> print datetime.date.today() 2014-12-29 >>> print datetime.date.today().isocalendar() (2015, 1, 1) ``` |
5
typcn 2014-12-29 17:30:51 +08:00
不太懂
|
6
typcn 2014-12-29 17:31:01 +08:00
new Date().toISOString()
"2014-12-29T09:30:41.784Z" |
7
msg7086 2014-12-29 17:31:28 +08:00 via iPhone
日期导致的错误其实挺常见的。
我以前做过的一个系统,只有在12月才会出错,连测试代码都没抓出来的错。到12月才会测试失败。 |
8
glasslion OP @clino 嗯,说到底, 还是 Java 的 这个API 设计的有问题。
python 里的 `isocalendar()`, shell里 的 `%G和%Y` 都不容易导致误用。 而 `YYYY` 和 `yyyy` 就容易混淆多了。 |
10
simonlei 2014-12-29 17:59:04 +08:00 2
A week year is in sync with a WEEK_OF_YEAR cycle. All weeks between the first and last weeks (inclusive) have the same week year value. Therefore, the first and last days of a week year may have different calendar year values.
For example, January 1, 1998 is a Thursday. If getFirstDayOfWeek() is MONDAY and getMinimalDaysInFirstWeek() is 4 (ISO 8601 standard compatible setting), then week 1 of 1998 starts on December 29, 1997, and ends on January 4, 1998. The week year is 1998 for the last three days of calendar year 1997. If, however, getFirstDayOfWeek() is SUNDAY, then week 1 of 1998 starts on January 4, 1998, and ends on January 10, 1998; the first three days of 1998 then are part of week 53 of 1997 and their week year is 1997. 就是说,今天这个星期的week year是2015... |
11
vjnjc 2014-12-30 13:19:40 +08:00
悲剧了,我也写了很多YYYY的代码...[sad
|