unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).