From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8J/3Np3FymKQiQAAbAwnHQ (envelope-from ) for ; Sun, 10 Jul 2022 14:27:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WDLBNp3FymJRigAAauVa8A (envelope-from ) for ; Sun, 10 Jul 2022 14:27:09 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 79B1D13769 for ; Sun, 10 Jul 2022 14:27:09 +0200 (CEST) Received: from localhost ([::1]:34374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAW1k-000109-H7 for larch@yhetil.org; Sun, 10 Jul 2022 08:27:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAW1A-0000zj-S8 for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 08:26:32 -0400 Received: from www85.your-server.de ([213.133.104.85]:33136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAW18-0001sL-Qu for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 08:26:32 -0400 Received: from ip-088-152-187-015.um26.pools.vodafone-ip.de ([88.152.187.15] helo=pc04.fritz.box) by www85.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1oAW11-0002EG-WD; Sun, 10 Jul 2022 14:26:24 +0200 Received: from [::1] (helo=pc04) by pc04 with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAW0y-004MDt-Ai; Sun, 10 Jul 2022 14:26:20 +0200 From: Olaf Dietsche To: emacs-orgmode@gnu.org Cc: Russell Adams Subject: Re: Alternatives to clocking in/out for reporting time In-Reply-To: References: Date: Sun, 10 Jul 2022 14:26:08 +0200 Message-ID: <87y1x1b1cv.fsf@pc04.fritz.box> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Sender: olaf@olafdietsche.de X-Virus-Scanned: Clear (ClamAV 0.103.6/26597/Sun Jul 10 09:56:43 2022) Received-SPF: none client-ip=213.133.104.85; envelope-from=olaf+list.orgmode@olafdietsche.de; helo=www85.your-server.de X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657456029; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=nTKMW7gu4OVpwmA22EQZWZHSoc9IZQW2QSFgItFzTN0=; b=C/TAkTDW5KmeUfHpETs/gHxDtPw8WOedhu0P5hNh+5onE32RQcXI1tUe4xlgBfZS/F4IP0 fPo/i5ElsdFGHtG4SJqjUElDEYudLVPcvoPFRLAqW3P/s6pCEcj9PX7x3OvVurKKBa4lZM FT7aHKXncOW8n3oR9E2gBz0dvnVQLo7brht1NVjyNPPIeOj6POFWy5tVBnYJPN7u+ORvW/ lKSNc2CW5mRP08IAr+O85eDgd7zqiYCnJod7epN8DtsYIQ8kJGAndmEs4XHFS3WksbzdT7 tSzCdY3EheY/Yw1T6E7edYzVSIdIcKHNA22xK0JxKjPrMCeTyBWkhAuzR7iNEw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657456029; a=rsa-sha256; cv=none; b=nsxYHdAq+aqqFJayYk/BqwqDZh+S1GkjQH2IDA9A3LWjVNhMnxIcfBJlElVKmoMiY3DgeO vc77g8PYf7yzvb+zdY0efFnfdwRmer6UnN6RSd2WD/xsLALW0N9Qoyg4chqzlqkydBbAHg XswZdJAIIQPXvDwMCQeRL/l/M2cddYWsZJ4mQJN5dSTmlWabnIyENfF+aicNkXnPFcRCqu rwnf0r2dkiOD/D1id/U5GVtXv85+dqzMTEbFHMzy9FiF8kKFg9R7s3RXrZXOZPF9qp17Wu +Sgw2G1y+XtRVBNhktJafGm5qfxqFQ8BfwCLJDpxVPIyJucgcTyc/kkDZQr+LQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.75 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 79B1D13769 X-Spam-Score: -3.75 X-Migadu-Scanner: scn0.migadu.com X-TUID: La8dhQSEPnq2 I also use org-mode clocking to record time spent. But instead of modifying/configuring org-mode, I use a post-processing Python script to collect and summarize clocked times. locale.setlocale(locale.LC_ALL, '') # ... def extract_times(line): # CLOCK: [YYYY-mm-dd WKD HH:MM]--[YYYY-mm-dd WKD HH:MM] => HH:MM m = re.search('CLOCK:\s*\[(.+? .+? .+?)\]--\[(.+? .+? .+?)\]\s*=>\s*(.+)', line) if m: ts = m.group(1) start = datetime.datetime.strptime(ts, '%Y-%m-%d %a %H:%M') ts = m.group(2) stop = datetime.datetime.strptime(ts, '%Y-%m-%d %a %H:%M') tm = m.group(3) spent = datetime.datetime.strptime(tm, '%H:%M') spent = datetime.timedelta(hours = spent.hour, minutes = spent.minute) logging.debug('time={}, spent={}'.format(line.strip(), spent)) return (start, stop, spent) Together with properties or tags or some other means, you can summarize and round collected times as needed. This can be done in any other (scripting) language, of course. setlocale is needed here, because I have German weekday names. Kind regards, Olaf Russell Adams writes: > I make extensive use of timestamps for billing (timesheet) > purposes. I'm looking to automate this more, and I find the existing > clocking system inadequate. I'm hoping someone can point me in the > right direction. > > Today I have log mode enabled so that each time I close a TODO item, > it records the date and time it was closed. At regular intervals while > working I add inactive timestamps to my notes. I've mapped that to a > single key, so it's quite fast. If I switch tasks, have an update, > made progress I want to note to myself, or leave and return I add an > inactive timestamp. I have well over 1000 inactive timestamps in my > current file. > > Later I can open my agenda view on the working file, choose my > timespan (week or month), enable log mode to show when items were > closed, and then enable inactive timestamps to view all of the > timestamps. This itemizes all the events organized by time into a > timeline. > > It's fairly straightforward from that timeline to count my hours based > on the record of where I spent my time. It is unfortunately a very > manual process. > > I find Org's clocking to be too detailed, and that it doesn't play > well with dynamically organized hierarchies of notes. I frequently > create and close subtasks, or switch parts of the tree. Clocking each > one is too much overhead, and too granular. I don't need to provide > down to the minute reports of each item. It also doesn't appear to > allow rounding of values, so I still have to adjust the results. > > What I envision is a way to count items in the agenda view to produce > a time report. Counting any inactive timestamp as 15 minutes, where if > a half hour or more is logged I round up to bill the hour. Closed TODO > items should count toward billing that whole hour. Clearly this should > be customized. > > The point is that I'm not worried about accounting time by task, > instead I'm aggregating tasks into accounting by whole hours. > > I'm looking at org-element, and it appears I'd have to do my own > agenda style scan of the whole tree to find items to classify by > hour. While I'm somewhat proficient at elisp, that sounds like a steep > wall to climb. > > Is there an iterative way to review items in an agenda view so I can > do the math to produce a report? > > ------------------------------------------------------------------ > Russell Adams RLAdams@AdamsInfoServ.com > https://www.adamsinfoserv.com/