From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: calculate weekday of birthday Date: Mon, 31 Jul 2017 18:26:36 -0400 Message-ID: <87shhctf8j.fsf@alphaville.usersys.redhat.com> References: <87379ciwfn.fsf@luna> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcJ9R-0003rl-9k for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 18:27:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcJ9O-0007jF-6A for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 18:27:01 -0400 Received: from [195.159.176.226] (port=39907 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcJ9N-0007io-W4 for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 18:26:58 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dcJ9C-0000u1-JH for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 00:26:46 +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 Salome Soedergran writes: > Hi everybody > > How can I make orgmode to give me the weekday of a specific date? > I have a list (org-table) with students' names and dates of birth that looks like this: > |------+-----------+------+-------+-----+-----+---------| > | Name | Firstname | year | month | day | age | weekday | > |------+-----------+------+-------+-----+-----+---------| > | Doe | John | 2001 | 05 | 21 | 16 | | > |------+-----------+------+-------+-----+-----+---------| > > #+TBLFM: @2$8..@>$6='(+ (- 2017 $5) (if(> $4 7) 0 1));L:: > > I have a formula to make orgtable calculate the age the student > reaches in the current academic year (Aug-July) but I don't know how > to get the birthday's weekday in the current year. Can anybody help > me? Thanks a lot in advance! > > Best, Salome > > ,---- | org-day-of-week is a compiled Lisp function in | ‘../org-mode/lisp/org-clock.el’. | | (org-day-of-week DAY MONTH YEAR) | | Returns the day of the week as an integer. `---- You'll have to translate that into a name: 0 = Sunday ... 6 = Saturday I believe. -- Nick