all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Dyballa <Peter_Dyballa@Web.DE>
To: Xavier Maillard <xma@gnu.org>
Cc: help-gnu-emacs@gnu.org, Charles Sebold <csebold@gmail.com>
Subject: Re: Week number
Date: Tue, 14 Oct 2008 23:37:45 +0200	[thread overview]
Message-ID: <89096C3D-4AA6-49CA-936B-76391EEE1FA1@Web.DE> (raw)
In-Reply-To: <200810142025.m9EKP5DO005068@zogzog.maillard.mobi>


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 – although here in Germany  
it's already 42nd week ... This number is displayed by 'date +%V'. My  
documentation says:

      %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).

So %W counts the complete weeks and %V counts the legal weeks. And  
(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  
Iceland, or any other country where the native language actually has  
syntax.
				– Peter da Silva







  parent reply	other threads:[~2008-10-14 21:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.994.1223980354.25473.help-gnu-emacs@gnu.org>
2008-10-14 12:43 ` Week number Charles Sebold
2008-10-14 12:53   ` Charles Sebold
2008-10-14 20:25     ` Xavier Maillard
2008-10-14 21:13       ` Charles Sebold
2008-10-14 21:37       ` Peter Dyballa [this message]
2008-10-14 21:42         ` Charles Sebold
2008-10-15  8:25           ` Xavier Maillard
     [not found]     ` <mailman.1043.1224016162.25473.help-gnu-emacs@gnu.org>
2008-10-14 21:09       ` Charles Sebold
2008-10-14 21:56         ` Drew Adams
2008-10-15  8:25           ` Xavier Maillard
2008-10-15 21:28       ` Harald Hanche-Olsen
2008-10-14  6:25 Xavier Maillard
2008-10-14 13:08 ` Paul R
2008-10-14 20:25   ` Xavier Maillard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=89096C3D-4AA6-49CA-936B-76391EEE1FA1@Web.DE \
    --to=peter_dyballa@web.de \
    --cc=csebold@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=xma@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.