From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Kevin Liu Newsgroups: gmane.emacs.devel Subject: 27.0.60; Asymmetry between (days-to-time) and (time-to-days) Date: Tue, 24 Mar 2020 02:18:27 -0700 Message-ID: <87imiuf6vw.fsf@nivekuil.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="41804"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.3.10; emacs 27.0.60 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 24 14:33:51 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jGjgl-000AkS-DC for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Mar 2020 14:33:51 +0100 Original-Received: from localhost ([::1]:48784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGjgk-00054h-8G for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Mar 2020 09:33:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43785) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGfhi-0002y6-Vk for emacs-devel@gnu.org; Tue, 24 Mar 2020 05:18:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGfhi-0006tM-1F for emacs-devel@gnu.org; Tue, 24 Mar 2020 05:18:34 -0400 Original-Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGfhh-0006sS-Oy for emacs-devel@gnu.org; Tue, 24 Mar 2020 05:18:33 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1585041510; cv=none; d=zohomail.com; s=zohoarc; b=mrE6gpWpIKAVxN6nNaHKxaPzCeqU9KW/N22h1QaJeAfKHsj6x/zpXGfmjXUAE5YptFPu2YFFKpA4OAiWlN2KgFFsKeWnlly/z+olRZxEjX0COkXLOyzqI619blY4+VDiiiUMzKUwViyanTsVnzbtbOWc7fFSbkFEiC0y+XriHxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585041510; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=fhGFvh+uTRdq6AbPpMkKBv4fSJH5a8zAwLa95uprU3c=; b=f6ESfdvDWlL4MgxDP4ZDjhNr3lJO19c0uBKGdtaHuiGW60DJtftCk1DQruu+wpbMueZX+LIDLVrbOkL+HLCKccNdqGTkGI+WJfmaGKnwnb8as+I9Yc0AuKLVHw1uWD5K4l3cYgbLQ4hn+IWZIjIebTy41gCJzAa1XTJ3tOvx7t8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=nivekuil.com; spf=pass smtp.mailfrom=kevin@nivekuil.com; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1585041510; s=mail; d=nivekuil.com; i=kevin@nivekuil.com; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=fhGFvh+uTRdq6AbPpMkKBv4fSJH5a8zAwLa95uprU3c=; b=KdLHFu9Pgal6ugaL6wS2Zk7qPjEgaN8DYqFwG0LFIB2DrtIGe1H8Flrufas1HraF RPyErlc666mFXJ2KhnvetdncuheV6GYvQDQ5PWbuAcxYVtQzZkIK0iS2nor1W+Jv172 8LAz61FlXgTl4HeT5tuxW9Wr4URL5brOYv4KiqK8= Original-Received: from machina (71.212.158.154 [71.212.158.154]) by mx.zohomail.com with SMTPS id 158504150843031.063001631569932; Tue, 24 Mar 2020 02:18:28 -0700 (PDT) X-ZohoMailClient: External X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 136.143.188.51 X-Mailman-Approved-At: Tue, 24 Mar 2020 09:33:10 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245757 Archived-At: The asymmetry between (days-to-time) and (time-to-days) is quite surprising: (format-time-string "%Y" (days-to-time (time-to-days (current-time)))) "3989" One could work around this by using (time-to-number-of-days) which uses the epoch time like (days-to-time), but that itself is awkwardly asymmetric as it returns a float, as well as the asymmetric naming. It's probably unrealistic that any existing behavior be changed, but it would at least be nice to have a builtin function that is the inverse of (time-to-days). Org-mode, for example, seems to use the Gregorian convention of (time-to-days) throughout, and to convert a (org-today) to a time requires this mess: (format-time-string "%Y" (days-to-time (- (org-today) 719162))) "2020"