From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 0NvzHtdxXmYxFgEAA41jLg (envelope-from ) for ; Tue, 04 Jun 2024 03:45:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id yGWgGNdxXmZR3AAA62LTzQ (envelope-from ) for ; Tue, 04 Jun 2024 03:45:59 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=h05ilhU+; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1717465559; 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=SBmNaBwJ2tda4fQFNhskH4++znLwbd69b9Top2tZEOY=; b=LQq5HE6eHutk8+8A0QkCO8ncBXGAQYKg9QQJ4MQn4hQ3zmvvwWr5Y6rkWHQE73RQnPPUpA AXZaZfUEYBW1hzDHz+rY7dCCaV5KTl5yY2vcz4k9qSPWuIXrbzZC7MKmMBEbf8t/YD3q9R 1NcPZnmTlrmwgiWG7UNCCDHZwtLyZCzeQGhSfE9IEsOroDLz459YFbTGkB7HOaD9srr4KE 5nlmgn/K1LBS3AcxjaKG3JGiyQqr8pkhMhqSeDeYwlwov2pX3sC9yAG5QP+U0Ci7bFmM/r G62BRn2xjYwhd5Uy3F2uUiJK6gzpZ90dUFxOjmpALfzZe4UH4sJIW12BNERHTA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=h05ilhU+; 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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1717465559; a=rsa-sha256; cv=none; b=Y3He+KJlwZkttfmb9+y9U1px1d6pes2udvZwQariubkPEi0UVYzGghunlcqXlxgCYFRw/N 4GLFQRpsw1XKcTWSd5m1GdHa9iP6mfBbBdHSQe8OaWnljgHLV984uAq3rb8dswxHUkej00 wvuQi1TJ/rbFs/XTxzzIauHbNG3FMh6Zja6uNHz3Of4vMNbFTRf4s2Uqy73z8UvSEI2WC3 37iMfrqDp5J0+YRqgiRqJt9fLfpEC9eGdN6cD7XLxoRV0aeVFEot2TgM8S+V+OWcqlFJKb cpgihstOezCwG3rMoq+NGwpTQV1XB8hmD1Ah0Kvk8Mm6AWuyHH0JR3rVKfrSag== 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 BC26F739EF for ; Tue, 4 Jun 2024 03:45:58 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEJEe-0002Qt-Q7; Mon, 03 Jun 2024 21:45:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEJEd-0002Qh-LB for emacs-orgmode@gnu.org; Mon, 03 Jun 2024 21:45:11 -0400 Received: from out-182.mta0.migadu.com ([2001:41d0:1004:224b::b6]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEJEb-00082l-SO for emacs-orgmode@gnu.org; Mon, 03 Jun 2024 21:45:11 -0400 X-Envelope-To: yantar92@posteo.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1717465505; h=from:from: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; bh=SBmNaBwJ2tda4fQFNhskH4++znLwbd69b9Top2tZEOY=; b=h05ilhU+1g/z7bvn3PQco3almrbhKHL+HH5S/yFjphb9LN0hGg5NTbF86e6fFhm/uXyD0q Kdw1u6MpjRMtk4qudQlo2a4JlBNus/3bJMm1LPudetaWWqhvwSQO6O4xg9jxkgyGy1jUuT 0YnEokz//u33NO54vByOQKePVj8Qx7N+FGb4oPVkZ7x9u5YJsepW9lSgOeiBlgVT0d0o4e BOTOTVsRqUfrQhY8n+K98w1/ow6Tizmtizi8MvDoX+hvZ1l2zLolYOZQ4kEbM0LKwUkbn/ xMmOpFpSbRlg2fhDNbFv1TKD5OLRE/K/1e/J94JIlRFVPD6UHj8n4rrbLAVvfg== X-Envelope-To: emacs-orgmode@gnu.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kyle Meyer To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] org-test: Fix zone-dependent miscalculation of days of week In-Reply-To: <87y17mm5pz.fsf@localhost> References: <87le3o5ogg.fsf@kyleam.com> <87y17mm5pz.fsf@localhost> Date: Mon, 03 Jun 2024 21:45:00 -0400 Message-ID: <87sext32hv.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:41d0:1004:224b::b6; envelope-from=kyle@kyleam.com; helo=out-182.mta0.migadu.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, 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -7.04 X-Migadu-Queue-Id: BC26F739EF X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -7.04 X-TUID: yJWhmdfOZGVb [ Sorry, I somehow managed to drop the References and In-Reply-to headers from my previous reply. I'll include that message again here along with some examples. ] Ihor Radchenko writes: > I suspect that the failures are because of your timezone. Yes, that matches my conclusion too and was what I was trying to convey in the commit message. > If my guess is right, there will always be some timezone where a given > number seconds from epoch is a different day... > I am not sure how to address this problem. How about my patch? Notice that format-time-string is invoked with ZONE set to t so that TIME is always taken as UTC. Examples -------- ;;; locale en_US.UTF-8 ;; local time zone (Japan in this demo) (format-time-string "%A %T %z" 259200) => "Sunday 09:00:00 +0900" ;; force UTC (format-time-string "%A %T %z" 259200 t) => "Sunday 00:00:00 +0000" ;; locale de_BE.UTF-8 ;; local time zone (format-time-string "%A %T %z" 259200) => "Sonntag 09:00:00 +0900" ;; force UTC (format-time-string "%A %T %z" 259200 t) => "Sonntag 00:00:00 +0000"