From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexis Subject: Re: babel and computing a number of months Date: Mon, 02 Jun 2014 18:13:50 +1000 Message-ID: <87d2erpw3l.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrNNb-0000wn-Kj for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 04:14:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrNNW-00089H-7d for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 04:14:03 -0400 Received: from mail-pb0-x22b.google.com ([2607:f8b0:400e:c01::22b]:53519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrNNW-000899-06 for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 04:13:58 -0400 Received: by mail-pb0-f43.google.com with SMTP id up15so3970376pbc.16 for ; Mon, 02 Jun 2014 01:13:55 -0700 (PDT) Received: from localhost (ppp118-209-145-187.lns20.mel6.internode.on.net. [118.209.145.187]) by mx.google.com with ESMTPSA id ib5sm19085460pbb.55.2014.06.02.01.13.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 02 Jun 2014 01:13:54 -0700 (PDT) In-reply-to: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Cc: emacs-orgmode Alan Schmitt writes: > I need to work with dates for some code/scripts I'm writing in a > document making heavy usage of source blocks and babel evaluation. The > good news is that I have access to many programming languages, so the > bad news is I don't know which one to choose. The problem I want to > solve is the following: I want to compute the number of months between > march 1st, 2014, and the beginning of the current month (so right now > it's 3, but on may 31st it was 2). Is there an easy way to do it in a > babel supported language? How about Perl with either DateTime::Moonpig: https://metacpan.org/pod/DateTime::Moonpig or Time::Piece: https://metacpan.org/pod/Time::Piece Alexis.