all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to calculate next sunday and format to string?
@ 2007-05-07  9:53 Sebastian Meisel
  2007-05-07 14:09 ` Solved: " Sebastian Meisel
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Meisel @ 2007-05-07  9:53 UTC (permalink / raw)
  To: Emacs Mailing List

Hallo,

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"

Thanks for any hints.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Solved: how to calculate next sunday and format to string?
  2007-05-07  9:53 how to calculate next sunday and format to string? Sebastian Meisel
@ 2007-05-07 14:09 ` Sebastian Meisel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Meisel @ 2007-05-07 14:09 UTC (permalink / raw)
  To: Emacs Mailing List

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-07 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-07  9:53 how to calculate next sunday and format to string? Sebastian Meisel
2007-05-07 14:09 ` Solved: " Sebastian Meisel

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.