From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harald Hanche-Olsen Newsgroups: gmane.emacs.help Subject: Re: Week number Date: Wed, 15 Oct 2008 23:28:23 +0200 Organization: Norwegian university of science and technology Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224106977 8716 80.91.229.12 (15 Oct 2008 21:42:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Oct 2008 21:42:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 15 23:43:56 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KqE9e-0004FS-Nb for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Oct 2008 23:43:42 +0200 Original-Received: from localhost ([127.0.0.1]:36514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqE8Z-0006O1-Tk for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Oct 2008 17:42:36 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!uio.no!ntnu.no!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: fiinbeck.math.ntnu.no Original-X-Trace: kuling.itea.ntnu.no 1224105846 5176 129.241.15.140 (15 Oct 2008 21:24:06 GMT) Original-X-Complaints-To: usenet@itea.ntnu.no Original-NNTP-Posting-Date: Wed, 15 Oct 2008 21:24:06 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) Cancel-Lock: sha1:vOKclBts3L483HFMuWChfLMYAy0= Original-Xref: news.stanford.edu gnu.emacs.help:163480 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58822 Archived-At: + Xavier Maillard : > I compared the results of your function and the result from a > simple (format-time-string "%W") for the current date and I got > week 42 for the former and week 41 for the latter. Can you > explain this ? There are different ways to count week numbers. You can bet that any function having -iso- in its name will use ISO week numbering, which corresponds to %V, not to %W. Here are the relevant bits from the strftime man page on freebsd. %U is replaced by the week number of the year (Sunday as the first day of the week) as a decimal number (00-53). %V is replaced by the week number of the year (Monday as the first day of the week) as a decimal number (01-53). If the week containing January 1 has four or more days in the new year, then it is week 1; otherwise it is the last week of the previous year, and the next week is week 1. %W is replaced by the week number of the year (Monday as the first day of the week) as a decimal number (00-53). (Note also that the proper way to write the week the ISO way is %GW%V, not %YW%V as you might think.) -- * Harald Hanche-Olsen - It is undesirable to believe a proposition when there is no ground whatsoever for supposing it is true. -- Bertrand Russell