From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: calculate weekday of birthday Date: Mon, 31 Jul 2017 17:24:21 -0500 Message-ID: <87a83kkzxm.fsf@alphapapa.net> References: <87379ciwfn.fsf@luna> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcJ79-00038a-Tj for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 18:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcJ76-0006R9-Lp for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 18:24:39 -0400 Received: from [195.159.176.226] (port=34840 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcJ76-0006Pb-Ec for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 18:24:36 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dcJ6t-00023U-7d for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 00:24:23 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hi Salome, The decode-time function returns a list that includes the day-of-week as a number from 0-6. You'll have to give it an encoded time, which you can use encode-time for. A wild idea would be to use the shell "date" command, which is overkill for this, but I just happen to have this code handy, in case you or anyone else might find it useful: #+BEGIN_SRC elisp (defmacro call-process-with-args (process &rest args) "Return results of running PROCESS with ARGS." (declare (indent defun)) `(with-temp-buffer (unless (= 0 (call-process ,process nil t nil ,@args)) (user-error ,(concat process " failed"))) (buffer-substring-no-properties (point-min) (point-max)))) (defun get-day-of-week (string) "Parse STRING with the shell `date' command and return day-of-week as string." (call-process-with-args "date" "-d" string "+%a")) #+END_SRC