From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: how to extract start time and end time from the CLOCK: property Date: Thu, 4 Sep 2008 08:56:56 +0200 Message-ID: <8A291741-D990-4420-A817-D513ECBEBC7D@uva.nl> References: <87vdxz6vnj.fsf@poczta.po.opole.pl> <87bpz5jb9f.fsf@poczta.po.opole.pl> Mime-Version: 1.0 (Apple Message framework v926) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kb8m8-0004Ad-4K for emacs-orgmode@gnu.org; Thu, 04 Sep 2008 02:57:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kb8m6-00049p-Lg for emacs-orgmode@gnu.org; Thu, 04 Sep 2008 02:57:03 -0400 Received: from [199.232.76.173] (port=47932 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kb8m6-00049m-IE for emacs-orgmode@gnu.org; Thu, 04 Sep 2008 02:57:02 -0400 Received: from ug-out-1314.google.com ([66.249.92.174]:23763) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kb8m5-0000oe-UM for emacs-orgmode@gnu.org; Thu, 04 Sep 2008 02:57:02 -0400 Received: by ug-out-1314.google.com with SMTP id m2so2642445uge.17 for ; Wed, 03 Sep 2008 23:57:00 -0700 (PDT) In-Reply-To: <87bpz5jb9f.fsf@poczta.po.opole.pl> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Seweryn Kokot Cc: emacs-orgmode@gnu.org On Sep 3, 2008, at 9:10 PM, Seweryn Kokot wrote: > Carsten Dominik writes: > >> Hi Seweryn, >> >> please see >> >> http://thread.gmane.org/gmane.emacs.orgmode/7430/focus=7430 > > Hi Carsten > > Thanks a lot! This is exactly what I wanted. In my case the following > works > > (defun my-org-column-cleaner (title value) > (cond > ((equal title "Start") > (if (and value (>= (length value) 40)) > (substring value 16 21) > nil ; there was no value, or it was a short string > )) > ((equal title "End") > (if (and value (>= (length value) 40)) > (substring value 40 45) > nil ; there was no value, or it was a short string > )) > (t nil))) > (setq org-columns-modify-value-for-display-function 'my-org-column- > cleaner) > > and > > #+COLUMNS: %50ITEM(Action) %8CLOCK(Start) %8CLOCK(End) > %7CLOCKSUM(Clocked) > > > The only problem is that Emacs+orgmode under Linux gives > > [2008-08-19 wto 07:26]--[2008-08-19 wto 08:26] > > and under Windows I got > > [2008-08-05 Wt 11:44]--[2008-08-05 Wt 13:47] > > I guess this is caused by the system locales. Is it possible to make > it > consistent with some settings in .emacs file? I don't know how to do this, byt you could use a regular expression to extract the time instead of a fixed substring, like (if (and value (>= (length value) 40) (string-match "[0-9]+:[0-9]+" value)) (mach-string 0 value) nil ; there was no value, or it was a short string HTH - Carsten