From mboxrd@z Thu Jan 1 00:00:00 1970 From: Georges Ko Subject: Re: Convert from date to week number, howto? Date: Fri, 03 Feb 2012 23:58:48 +0800 Message-ID: References: <87liol1a8z.fsf@iro.umontreal.ca> <81mx91qid0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:59012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtMPm-0005XI-KU for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 11:55:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtMPg-0003Pz-RO for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 11:55:10 -0500 Received: from plane.gmane.org ([80.91.229.3]:56721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtMPg-0003Pe-KP for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 11:55:04 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1RtMPf-0006in-UT for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 17:55:03 +0100 Received: from 114-34-168-13.hinet-ip.hinet.net ([114.34.168.13]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Feb 2012 17:55:03 +0100 Received: from gko by 114-34-168-13.hinet-ip.hinet.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Feb 2012 17:55:03 +0100 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 To: emacs-orgmode@gnu.org Jambunathan K writes: >> I sometimes have to convert from a date to a week number, > > Try this. > > (org-odt-format-date "<2011-12-31 Sat>" "%U") > (org-odt-format-date "[2011-12-24 Sat]" "%U") > > You can steal the implementation. The functions have nothing to do with > org-odt, btw. Another way to get the week of the year is: (require 'calendar) (require 'cal-iso) (car (calendar-iso-from-absolute (calendar-absolute-from-gregorian (list month day year)))) -- Georges Ko gko@gko.net 2012-02-03