From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wHV9KedIQWBxHAAA0tVLHw (envelope-from ) for ; Thu, 04 Mar 2021 20:53:59 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id DYFXJedIQWCOXgAA1q6Kng (envelope-from ) for ; Thu, 04 Mar 2021 20:53:59 +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 aspmx2.migadu.com (Postfix) with ESMTPS id E57D9D93A for ; Thu, 4 Mar 2021 21:53:58 +0100 (CET) Received: from localhost ([::1]:43618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHuys-0004jC-2W for larch@yhetil.org; Thu, 04 Mar 2021 15:53:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHupM-0002MY-9T for emacs-orgmode@gnu.org; Thu, 04 Mar 2021 15:44:08 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:44171) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHupD-0008Mv-Iu for emacs-orgmode@gnu.org; Thu, 04 Mar 2021 15:44:03 -0500 Received: by mail-pg1-x52d.google.com with SMTP id a4so19656015pgc.11 for ; Thu, 04 Mar 2021 12:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=bj2RmQ30XLUTzIwHLxO64LKvnpCiX2aBwbBaOQpl3yo=; b=Jd0sbWA3U4mhwf3cvOKfgCiLvhMUyRpVDPSqIK8tNbsx5vFNJVwFikkLO8vD01Z8PF jMdkFMtDdIzR73p1RHYuA2jARsWBSI+lE1/yRd3mRctCaDBLXxTtXiXn2iwKpGmpM5ag ajwvrwc2oJUy8zPt/0cwposVrGUf/zHwOelcSjMENdlIX0MqCR1F2kKHVIdYEW7El1HT qVIXRA7FUxt/momtxCSH/TQ5AIXOeniuXxgjIHaxIf2Nd5sj5T0p6RNvH9cL/22DVsdj TI0d48SUVErXS7qMqN7iHMalQxP+TNjB2hA22+2BIdKq0moXRNtGb92zl4suZZOnKrJx 9low== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=bj2RmQ30XLUTzIwHLxO64LKvnpCiX2aBwbBaOQpl3yo=; b=UkRPeWMXrfI+X9HhdGQS0oE5h/1Y3HTiBEmfRxl9h0TLvsRAhjtMqJV1zUmQEYFJMo Bm4HF+W2GxgVh2oPCAXLfEu95iOdFaTr7LLXY4W/lPNzvtSLjljIWEy2xVWa73ELl7fl sCbfRowq+nqa46JGUKlKRE+/uuX90vGrEaEeWqSQMYxxAYGYCQvsIQZrK1NfsfeTy9m/ X56TrNTJ1ibjPmww2aiag9mbc7m8Lad+qquu7TyDw4I2QWv9WGKI5pzZ/qOP95zVpVTr /vYHFIOn0ug7l9oC7Q3DBdT89Vgsd3t3K/UFBqI+1QdlroS9zvJlqNMbNqN3k7Uhfq/Y 0XRA== X-Gm-Message-State: AOAM533+YPOW5qWRaKh9HMHj6eBqVNvIjNdNFCoW5czAUsEOoGzkbsS9 y4W9p1snwh+UwxHxZ1GPhy5pP5/Ad+4= X-Google-Smtp-Source: ABdhPJywJuqLBDfOg+90Wtgp6amyAVw64vpofInvvz3wph9sy6pSBs+VjtqTxYa2b5U8LSL+gYU48g== X-Received: by 2002:a05:6a00:16c7:b029:1b6:68a6:985a with SMTP id l7-20020a056a0016c7b02901b668a6985amr5464776pfc.44.1614890637929; Thu, 04 Mar 2021 12:43:57 -0800 (PST) Received: from tim-desktop (106-69-108-26.dyn.iinet.net.au. [106.69.108.26]) by smtp.gmail.com with ESMTPSA id j11sm142647pjb.11.2021.03.04.12.43.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 12:43:57 -0800 (PST) References: <87wnunz30x.fsf@mat.ucm.es> <87ft1byvv9.fsf@gmail.com> <87czwfyp5u.fsf@mat.ucm.es> <87h7lqu9u4.fsf@gmail.com> <87ft1ay8f0.fsf@mat.ucm.es> User-agent: mu4e 1.5.8; emacs 27.1.91 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: org-capture-templates: %date is too long Date: Fri, 05 Mar 2021 07:37:22 +1100 In-reply-to: <87ft1ay8f0.fsf@mat.ucm.es> Message-ID: <87zgzizm2d.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=theophilusx@gmail.com; helo=mail-pg1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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=1614891239; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=bj2RmQ30XLUTzIwHLxO64LKvnpCiX2aBwbBaOQpl3yo=; b=Wk7htsqeeK9xMeIYgYbtpJ4CoRtwIXqrLOOVK7NdCxDIVLZikaxCygWB43i3eEpdr8XOOB Zciz2ey2jEUcaNIyXcAjs/LKWnLI79w+Tg3/mu5tGl9CcKmQwnm2i/tXJcoF6kvC9w6FnP vVCxctQzbIJ6FSCyJzXpvMgObU3dnmRUUme8QOQkIVAbJf4MyPblzGqEVQmuJD7FukPcRH 2qdm1D68niTnMY1gFY7ozxkKkHDTxIewr31NunlXqjR/Ze/ndCL9iOXIifHBIBMiUvz2P4 hIGkxh5y6vbQGPRFol7+n02RhBNtFPDfwWUmqrvJTrQeJudkjO65pLWqHHnrAA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614891239; a=rsa-sha256; cv=none; b=DdmC2vPGIdAyDw/2n0j6dmk42UcTI/ESQ4UK/QwJDPc37ZqjbmASyuYVyfkACGmHXg2A+L 511LWkyw8/B23nYo0ArMSIoiBX3tAf4trdxi41IneBrJR4TSEuxxNSosJRWiXkVYNTTFbS +MOamNxprmYoLQ+hnOYuXp0HaBR1CM9BCmOSn3Q13pIMWjEzVeeBNg9jFLf2TEMPS84TNL d8IHCl+Y/WcHycWKmNQ2jcywE2IdTpByRNd+/lmxPfie1iIJYWOCu2sm9b6PiTTmOcU5ru ihL9gx39WdGf7MpOcUtHFBcD135+y0R0odzGTK8PaCKjPx3AgctBaWcOvcW1AA== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Jd0sbWA3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx2.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: -3.06 Authentication-Results: aspmx2.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Jd0sbWA3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx2.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: E57D9D93A X-Spam-Score: -3.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: CDqnEOeBNMJb Uwe Brauer writes: >>>> "RP" == Robert Pluim writes: > > >>>>>> On Thu, 04 Mar 2021 15:22:21 +0100, Uwe Brauer said: > Uwe> Sorry, you misunderstood me, this time string, inserts the time string, > Uwe> when I execute the capture, but I want to extract the time string, when > Uwe> the message was received. This is why I used > Uwe> %:date > Uwe> in my first attempt, that works but inserts > Uwe> Tue, 2 Mar 2021 19:35:03 +0100 > > Uwe> Which I find way too long. > > Uwe> Just > Uwe> Tue, 2 Mar 2021 > > Uwe> Would be fine or 02.03.2021 > > Uwe> But not the hour, seconds etc > > > It looks like the %:date handling respects the > > 'org-time-stamp-formats' variable, so if you can arrange for that to > > be let-bound appropriately during the capture process, it might do the > > right thing. > > Hm that variable is set to > > Its value is ("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>") > > So if I call with a prefix it inserts > <2021-03-04 jue 21:19> > > But nothing like +0100 > > I am not acquainted with let-bound (only with let) > > So are you saying I should may use defadvice to modify org-capture? Capture templates allow inclusion of an arbitrary elisp expression with %(EXP). You could try defining an elisp function which accepts %:date as an argument (i.e. a string arg) and formats it using normal elisp date/time functions and returns the result as a string and then call that function within your template? -- Tim Cross