|
2001-02-19
| ||
| 02:07 | • Closed ticket [225965ffff]: clock format $date -format "%Y-%W" fails... artifact: 6ff961801c user: kennykb | |
|
2001-02-16
| ||
| 02:19 | • Ticket [225965ffff]: 4 changes artifact: ea35226e67 user: kennykb | |
|
2001-02-09
| ||
| 03:21 | • Ticket [225965ffff]: 4 changes artifact: 07caefb7d6 user: kennykb | |
|
2001-02-08
| ||
| 08:01 | • Ticket [225965ffff]: 2 changes artifact: 57eaf49aa9 user: dgp | |
|
2000-12-21
| ||
| 06:11 | • Ticket [225965ffff]: 4 changes artifact: 8c25d3bf85 user: olovbergqvist | |
|
2000-12-20
| ||
| 23:37 | • Ticket [225965ffff]: 5 changes artifact: fa18ab5bc7 user: dkf | |
|
2000-12-16
| ||
| 09:51 | • New ticket [225965ffff]. artifact: d1c0026ebd user: olovbergqvist | |
[clock format $date -format "%Y-%W"] fails on w 53
Closed / Fixed225965ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-12-16 09:51:34
[clock format [clock scan "12/31/1998"] -format "%Y-%W"] fails. The result is 1998-52, but should be 1998-53. I suspect the same error happens for the date 01/01/2008 resulting in 2008-00. I do not have a calendar for 2008. The Swedish weeknumbering is ruled by the standard (SIS 0 102 12) based on rules from ISO. In short: A week number is always correspondant to 7 days. Week 1 is the first week of the year that contains 4 days or more of the new year.
dkfplain2000-12-20 23:37:23
Confirmed. (Am I right in saying that the fourth day of January should always be in week 1?)
olovbergqvistplain2000-12-21 06:11:41
Hello, It seems that the ISP standard is ISO 8601. ANSI does not seems to include a standard. Your follow-up question. Another way to put the rule is: The year shift week is given to the year on which the majority of it's days belongs. So if the four days of that week belongs to the old year it will be number 53, if 52 is already taken. http://www.its.se/ITS/datum-m-m/iso8601.pdf http://www.its.se/ITS/datum-m-m/kent-02.htm On MSDN-Sweden this article tells how to fix that Microsoft SQL Server cannot tell the correct week number through it's function DatePart(). This is because Microsoft SQL Server doesn'tknow which is week 1 of the year. A solution exists. ... (swedish standard) Which means that if new years eve occurs on Mondat-Wednesday that week is regarded number 1 of the new year. A code example is given: http://www.microsoft.com/sverige/msdn/knowledge/tips/tips000419.asp
dgp Ticket [225965ffff]: 2 changes
[History diff]2001-02-08 08:01:45
kennykbplain2001-02-09 03:21:24
This is actually a documentation problem. %W is defined in 'strftime' to be the week number of the year, with the first Monday of the year defined to begin week 1. The correct format specifier for ISO-8601 week-of-year is %V. (There is also a %U, which defines week 1 to begin on the first Sunday of the year.) compat/strftime.c contains correct code for %V, but the man page is missing it. (It's also missing a bunch of the other formats).
kennykbplain2001-02-16 02:19:04
Documentation change uploaded as patch # 103815. Can someone proofread it for me before I commit it?
kennykbplain2001-02-19 02:07:48
Documentation changes to clock.n committed to SourceForge (revision 1.10).
Log in (anonymous is fine) to add a comment.