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

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

Solved: how to calculate next sunday and format to string?


From: Sebastian Meisel
Subject: Solved: how to calculate next sunday and format to string?
Date: Mon, 07 May 2007 16:09:46 +0200
User-agent: Thunderbird 1.5.0.10 (Macintosh/20070221)

Sebastian Meisel schrieb:
I'd like to have the function that return the date of next sunday, or any other weekday as a formated string.

(formate-time-string-for-next-weekday "7" "%u.%m.%Y")
   -> "13.5.2007"
(require 'calendar)
(setq calendar-date-display-form '((format "%2s.%2s.%4s" (substring
(concat "0" day) -2) (substring (concat "0" month) -2) year)))

(calendar-date-string (calendar-nth-named-day in-n-wochen week-day-number
      (string-to-number month) (string-to-number year) (string
-to-number day))))

did the trick, where in-n-wochen means and week-day-number are
selfexplaining variables.





reply via email to

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