From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oPKHOpnFZGJDBgEAbAwnHQ (envelope-from ) for ; Sun, 24 Apr 2022 05:35:54 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2GaHOZnFZGJkLgAAG6o9tA (envelope-from ) for ; Sun, 24 Apr 2022 05:35:53 +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 806382CCEB for ; Sun, 24 Apr 2022 05:35:53 +0200 (CEST) Received: from localhost ([::1]:42986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niT2O-0005Oo-OC for larch@yhetil.org; Sat, 23 Apr 2022 23:35:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niT1H-0005ON-0s for emacs-orgmode@gnu.org; Sat, 23 Apr 2022 23:34:43 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:40450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1niT1F-0006qc-4n for emacs-orgmode@gnu.org; Sat, 23 Apr 2022 23:34:42 -0400 Received: by mail-pf1-x432.google.com with SMTP id i24so11752741pfa.7 for ; Sat, 23 Apr 2022 20:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=sPPWi0Eo6En4pQ+ifFMRICNM/yGIDfpNeinlILYns5w=; b=Pi5MMCwp6pl5GQ6i2mpYfxn1a0qD0kU9jUfeOstahn1sATDPxxzD0aVywXsgggt4qr zbS8iEodHBeqEMazhIaVIKRxuDu9qsYlYhwiRcoiXTNCwE1HX5Jh8yrRrAckmrnzPF1c QrGfuJ4DrfrsoqUJkJD8o1AODr4kuuUkjbotpjnObVponpHJ4e5TCUzCiDiLB+XXKoXN FN+LtuMUtEnrHlCwaQldo8KKfP6mOEU6loXbGOVh5U9rabnRkrugwBz9u+uYo7K0grZA m8/RdrIv3nqaRJ/3BUr95AiwIZZ57s6TY2nVRjZu4bWm55NWvFwNPb/TKvnVRFAEdYIy l89g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=sPPWi0Eo6En4pQ+ifFMRICNM/yGIDfpNeinlILYns5w=; b=RZaK9c9IY5DyF2dUxXoQhfHkYLzijLC1a8peOOmzWaEBVlBG4tw3QqJcyCawfdq+X5 qPS6H+VfqlaB2c91WEDeK5ydQzMqzLTUxmMJ9FRu/qe619XK5Zhzx7WF5Y/CxJKP7+DT 3sqV5Fdo9euwTvmpVOzQV9ZZa/iQsSBnkMBp1TRbPwXBrf1yc3v3tiIS3gq5VjeP6dB8 YaNE2nOAfUEodvACg9wtQdAuGavKl4JTul9VKh7fn6X/THGdEfGNaw7YRKu9tPM89sel LYrT48qjUVQQQAwmTW2o0t7W1RLmCR2bKxLI/V87DTqMgPDUX9S6Ly1xiY6G3jS73uHJ TknA== X-Gm-Message-State: AOAM5305TPzOy7ajWXlDnPdPHw/lLtj/8AXVABW9YqnYHzfbZ875j+oo S0AIBPlUSd5YJG/qE5vkHsc= X-Google-Smtp-Source: ABdhPJxX/S5aRjccyFM09e4ajrNvzEthDl1MoaWI1vBJO6YLGprt2qBGQ+Ph7l8ezF+G4G0MKu8Jlg== X-Received: by 2002:a63:6c8a:0:b0:398:5208:220a with SMTP id h132-20020a636c8a000000b003985208220amr10047470pgc.176.1650771279570; Sat, 23 Apr 2022 20:34:39 -0700 (PDT) Received: from localhost ([50.7.251.66]) by smtp.gmail.com with ESMTPSA id g6-20020a62f946000000b0050ad31cc8fcsm7282488pfm.12.2022.04.23.20.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Apr 2022 20:34:38 -0700 (PDT) From: Ihor Radchenko To: Paul Eggert Subject: Re: [DRAFT][PATCH] org-encode-time compatibility and convenience helper In-Reply-To: <329701d8-3682-51fd-f086-4e1e06bc9f8d@cs.ucla.edu> References: <7f4ea652-7d22-fb61-f873-5e92f078c9e6@gmail.com> <87mtgcmckj.fsf@localhost> <329701d8-3682-51fd-f086-4e1e06bc9f8d@cs.ucla.edu> Date: Sun, 24 Apr 2022 11:35:28 +0800 Message-ID: <87o80r17cv.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=yantar92@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Cc: Max Nikulin , org-mode-email 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=1650771353; 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:dkim-signature; bh=sPPWi0Eo6En4pQ+ifFMRICNM/yGIDfpNeinlILYns5w=; b=YbD4mtZqLtCD8wLfKl/YH7gsMRs80DqexZfHsB36RfkJmk0foHcr+Yww/kzx9OQaFvHPgb lkdTmeZUgUPwdEJfVydb0jiAp7Feh/DquV16hrIZZyg+2xsQ+9G2hwk421F0YOvmSqcdkv Yk277CX/OVLq6EknDRJh17jSNd7Y6G2RoMTCbybwSHmMd/Ey5G2vql2fGYmcvMY5T/5/or wo/gOdWRHinCB5xgZTEW6HA/74hcgbdNIMkCcxK6OmUnZmV2bYm9oTS4YTq/wPO0Duluk6 4R5FokBSBnL3opSDps8hdk5GFf2RBchg8AQMzjY++BOsSY7ujzuEAQaKWN3P/Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650771353; a=rsa-sha256; cv=none; b=VAIXMPzFtjGFpD+zHm5emEb0BSEDtzoEyNPgMiTZrS7hNEjHCKIellKlgOtw+7LK/utVTp xlHzHFmUUhIOc6IVcWZ/+zWjAnFIg+KLAknYAPtmcBUy9H2kF5Am9ZOt87y+E0fXBraVQe 4A+qgpn912ww277dbc1pHGX5+mAzloI/o6PagPLNM8HV02WxNmexO8+MUuDWw2+BTANomt 5pM6VAidgLDRFrpvaj4PqPzR1YOVqAbJAg8j04toHLydgX31kK67GK5g1LTunMwhntwkFB BOQt06TEE53XsrQX3YF8JUCKxFV8EfriEszIEgfE6yH4z+rxZCM8bzS+ffK9Hg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Pi5MMCwp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 6.69 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Pi5MMCwp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 806382CCEB X-Spam-Score: 6.69 X-Migadu-Scanner: scn1.migadu.com X-TUID: KWxPQfstljNq Paul Eggert writes: > On 4/23/22 01:25, Ihor Radchenko wrote: >>> + (should (string-equal >>> + "2022-03-24 23:30:01" >>> + (format-time-string >>> + "%F %T" >>> + (org-encode-time '(01 30 23 24 03 2022 nil -1 nil))))) >>> ... >> These tests will be executed using system value of TZ. I am not sure if >> tests are not going to break, say, in southern hemisphere or at some >> other bizzare values of TZ. >> > > Good point: that test won't work in a time zone where the local time > 23:30:01 does not exist due to a daylight-saving spring-forward transition. Note that it is rather hypothetical case. It's not just about 23:30:01, but also about March 24 date. I am now checking https://en.wikipedia.org/wiki/Daylight_saving_time_by_country The day saving changes in March are: - Second Sunday - Last Sunday - Friday before last Sunday - Last Friday - 20 or 21 March (Iran) - Fourth Sunday March 24, 2023 will be the last Friday before last Sunday in March... The conclusion is: it is all tricky and I would not bet on trying to find a "safe" date for an arbitrary present time zone DST. It would be better to set some test TZ for testing and be done with all this ambiguity. Best, Ihor