From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Meisel Newsgroups: gmane.emacs.help Subject: Solved: how to calculate next sunday and format to string? Date: Mon, 07 May 2007 16:09:46 +0200 Message-ID: <463F332A.80003@web.de> References: <463EF703.7060304@web.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1178547124 30901 80.91.229.12 (7 May 2007 14:12:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 May 2007 14:12:04 +0000 (UTC) To: Emacs Mailing List Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 07 16:12:03 2007 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 1Hl3wY-0001iK-Qd for geh-help-gnu-emacs@m.gmane.org; Mon, 07 May 2007 16:12:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hl43X-0002c0-2R for geh-help-gnu-emacs@m.gmane.org; Mon, 07 May 2007 10:19:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hl433-0002XX-TM for help-gnu-emacs@gnu.org; Mon, 07 May 2007 10:18:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hl432-0002X7-5y for help-gnu-emacs@gnu.org; Mon, 07 May 2007 10:18:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hl432-0002X2-24 for help-gnu-emacs@gnu.org; Mon, 07 May 2007 10:18:44 -0400 Original-Received: from fmmailgate02.web.de ([217.72.192.227]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hl3w1-000643-PJ for help-gnu-emacs@gnu.org; Mon, 07 May 2007 10:11:30 -0400 Original-Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id 585D37AD2FCF for ; Mon, 7 May 2007 16:09:51 +0200 (CEST) Original-Received: from [77.179.117.97] (helo=[192.168.178.26]) by smtp07.web.de with asmtp (WEB.DE 4.108 #197) id 1Hl3uR-00070r-00 for help-gnu-emacs@gnu.org; Mon, 07 May 2007 16:09:51 +0200 User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) In-Reply-To: <463EF703.7060304@web.de> X-Sender: sebastianmeisel@web.de X-Provags-ID: V01U2FsdGVkX1+iWAJ6jLvSe2OSt1rR8/l/0CebJ49xJ4VjKv/L 2oEBQiOc9FXI05wvgFM6IlJz8d3/SHI+vZykeky9y94fPx9gOS NBJXJbVkSy85/fs3VI+g== X-detected-kernel: 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:43791 Archived-At: 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.