[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Counterpart to time-to-days?
From: |
Tim Landscheidt |
Subject: |
Re: Counterpart to time-to-days? |
Date: |
Thu, 30 May 2019 13:52:15 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Bruno Barbier <brubar.cs@gmail.com> wrote:
>> | ELISP> (format-time-string "%F" (current-time))
>> | "2019-05-29"
>> | ELISP> (format-time-string "%F" (days-to-time (time-to-days
>> (current-time))))
>> | "3988-05-29"
>> | ELISP>
>> So time-to-days seems to count the days from 0001-12-31bce,
>> while days-to-time (without being explicit about it) seems
>> to treat days as counting from epoch (1970-01-01).
>> What is the intended counterpart to time-to-days?
> Are you looking for `time-to-number-of-days` ?
> (format-time-string "%F" (days-to-time (time-to-number-of-days
> (current-time))))
> => 2019-05-29
Thanks, that works. (Now on for some time zone mangling …)
Tim