help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Week number


From: Charles Sebold
Subject: Re: Week number
Date: Tue, 14 Oct 2008 07:53:41 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (windows-nt)

On 14 Oct 2008, Charles Sebold wrote:

> Here's how org-mode does it:

Sorry, this is really what you were asking for, then:

(defun crs-iso-week (&optional date)
  "Week number of ISO date of Gregorian DATE.
Defaults to today's date if DATE is not given."
  (require 'cal-iso)
  (let* ((d (calendar-absolute-from-gregorian
             (or date (calendar-current-date))))
         (iso-date (calendar-iso-from-absolute d)))
    (format "%dw%2d" (extract-calendar-year iso-date)
            (extract-calendar-month iso-date))))
-- 
Charles Sebold                                     14th of October, 2008


reply via email to

[Prev in Thread] Current Thread [Next in Thread]