From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mAXmK8FQImEuJgAAgWs5BA (envelope-from ) for ; Sun, 22 Aug 2021 15:27:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uJBiJ8FQImFhIgAAbx9fmQ (envelope-from ) for ; Sun, 22 Aug 2021 13:27:29 +0000 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 52F361D28F for ; Sun, 22 Aug 2021 15:27:29 +0200 (CEST) Received: from localhost ([::1]:54532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHnVY-0000Xu-Dy for larch@yhetil.org; Sun, 22 Aug 2021 09:27:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHnUd-0000Ul-QK for emacs-orgmode@gnu.org; Sun, 22 Aug 2021 09:26:31 -0400 Received: from ciao.gmane.io ([116.202.254.214]:54686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHnUZ-0007GU-J1 for emacs-orgmode@gnu.org; Sun, 22 Aug 2021 09:26:31 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mHnUW-0006J2-A0 for emacs-orgmode@gnu.org; Sun, 22 Aug 2021 15:26:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Tim Landscheidt Subject: Testing if a scheduled date is prior to another date Date: Sun, 22 Aug 2021 13:26:18 +0000 Organization: http://www.tim-landscheidt.de/ Message-ID: <87a6l9ehl1.fsf@vagabond.tim-landscheidt.de> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:94oIFzcOTAFZHzYxwXdpb9DsmPU= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629638849; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=5V+CokXXcUOSEfnsQE03opeU58jEre7bPaveDO6Lscw=; b=mgvloFMFHeKCvKARbIv6F4ovsYBGGijsR60zerYT+SCeH5GYb71sCWuS+8fF+9NQK9RT3L 7RxpSFuW4mcfnVfo0YnJP6skr2kvmQ5Z47YkQDOFgzHcDt+ya/IQ8mvFq/dGf0jtM5G+nB 6EfJ1tdqCA0C3R+iRWII4unO3a4kpfZrV9EVAViv5N74t06DOWGUciLydTirg+ovhmqNhC FZ3B9u1ZEZ0NGgQgmTqbmWRwslYyPip7YXCDoR9LfZwPOuaRahJpQFufi/mqBzq54JkZYU p41w6fM7f5ZLwvVpF03STmlP7Vjao39IhMie2OaYiQEpQsop7l2NbB8DvrxqlA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629638849; a=rsa-sha256; cv=none; b=joHCgQZp03dLdFRF3+RJqjXGfBb9NB68g6RoVfzwyozEoppl+DdBfr0ZX+xV1t0ERa5wUj EizjJerLnmcjEaEEym/FDhwTuQTXMv/my+BnpWF4PMHKGYdFl5UiTD5unpIil89dB5nQiS le5M8mUJdrh7ObRSUV6P8ayaMoBWu54N1IAnO2+ADO39hxwznHOd9Oeek8PKq0IZOaJs7H Sf1PZFAw5D9EZa5miOZQ0zHsFjBZRUlw6MYXn4yQIb/tmxZ8ExeX0Jzw/m7/63OkjXMEzA hinXy1QqfhsMYeDnlIyFJYDkkrO3ApXONmuR8dVQwTURUhLxr9ihbTrfffmdaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.92 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 52F361D28F X-Spam-Score: -1.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: QaoeLQLmUEUg Hi, in a capture template, I want to test whether the scheduled date for a specific task is prior to another, calculated date (and depending on the answer, insert a checkbox or not). I can get the scheduled date for the task by: | (with-current-buffer (find-file-noselect "/path/to/file.org") | (save-mark-and-excursion | (goto-char | (org-find-entry-with-id "TASK_ID")) | (org-element-property ':scheduled (org-element-at-point)))) which returns a structure like: | (timestamp | (:type active | :raw-value "<2021-08-30 Mo 08:00 .+4d>" | :year-start 2021 | :month-start 8 | :day-start 30 | :hour-start 8 | :minute-start 0 | :year-end 2021 | :month-end 8 | :day-end 30 | :hour-end 8 | :minute-end 0 | :begin 436166 | :end 436192 | :post-blank 0 | :repeater-type restart | :repeater-value 4 | :repeater-unit day)) However, comparing this value with org-time< & Co. is futile as org-2ft always returns 0. Before I wade through the various functions to build a con- version chain, what is the best practice to compare time- stamp values with dates? (And if there is an org-mode func- tion that checks if the task at point is scheduled prior to another date, I'd appreciate pointers as well :-).) TIA, Tim