From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Dyballa Newsgroups: gmane.emacs.help Subject: Re: Week number Date: Tue, 14 Oct 2008 23:37:45 +0200 Message-ID: <89096C3D-4AA6-49CA-936B-76391EEE1FA1@Web.DE> References: <200810142025.m9EKP5DO005068@zogzog.maillard.mobi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1224020534 4352 80.91.229.12 (14 Oct 2008 21:42:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Oct 2008 21:42:14 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, Charles Sebold To: Xavier Maillard Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 14 23:43:14 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 1KprfZ-0003IF-OF for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Oct 2008 23:43:10 +0200 Original-Received: from localhost ([127.0.0.1]:46613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KpreU-00044a-Ut for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Oct 2008 17:42:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KprdA-0003Di-Dh for help-gnu-emacs@gnu.org; Tue, 14 Oct 2008 17:40:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kprd8-0003CY-Rm for help-gnu-emacs@gnu.org; Tue, 14 Oct 2008 17:40:40 -0400 Original-Received: from [199.232.76.173] (port=51753 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kprd8-0003CS-N3 for help-gnu-emacs@gnu.org; Tue, 14 Oct 2008 17:40:38 -0400 Original-Received: from fmmailgate01.web.de ([217.72.192.221]:60420) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kprd4-0003qU-OH; Tue, 14 Oct 2008 17:40:35 -0400 Original-Received: from smtp06.web.de (fmsmtp06.dlan.cinetic.de [172.20.5.172]) by fmmailgate01.web.de (Postfix) with ESMTP id 2A47CF6277B2; Tue, 14 Oct 2008 23:37:53 +0200 (CEST) Original-Received: from [91.35.193.212] (helo=[192.168.1.2]) by smtp06.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.109 #226) id 1KpraS-00011H-00; Tue, 14 Oct 2008 23:37:53 +0200 In-Reply-To: <200810142025.m9EKP5DO005068@zogzog.maillard.mobi> X-Mailer: Apple Mail (2.753.1) X-Sender: Peter_Dyballa@web.de X-Provags-ID: V01U2FsdGVkX19nIsrDf+DJcqwaqn1YFxf0kx7W5QIz0HKL1CVJ 7YYvRqIDJDpnApTl+M52ODGcy471EHefZHn/bfs2cJg1ydvxm1 vKLAqqW00CMlYc31315g== X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 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:58783 Archived-At: Am 14.10.2008 um 22:25 schrieb 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 ? On the command line 'date +%W' returns 41 =96 although here in Germany =20= it's already 42nd week ... This number is displayed by 'date +%V'. My =20= documentation says: %V is replaced by the week number of the year (Monday as the =20= first day of the week) as a decimal number (01-53). If the week =20 containing January 1 has four or more days in the new year, then it =20 is week 1; otherwise it is the last week of the previous year, and =20 the next week is week 1. %W is replaced by the week number of the year (Monday as the =20= first day of the week) as a decimal number (00-53). So %W counts the complete weeks and %V counts the legal weeks. And =20 (format-time-string "%V") returns 42 for me. See also 'man strftime'. -- Greetings Pete The world would be a better place if Larry Wall had been born in =20 Iceland, or any other country where the native language actually has =20 syntax. =96 Peter da Silva