|
From: | Paul Eggert |
Subject: | Re: encode-time vs decode-time |
Date: | Mon, 5 Aug 2019 18:48:21 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
Lars Ingebrigtsen wrote:
I think there should be a function to convert between these "internal second time" formats. Like... `convert-time-format', which would be like `(encode-time time 'list)' (etc). And then leave encode-time/decode-time a simple pair that would do nothing but convert between "internal second time format" and "decoded time format".
OK, after some cogitation I installed something along those lines into master. I called the new function 'time-convert' by analogy with the existing functions time-add etc. So now, as you suggested, encode-time has reverted to its old role of converting from decoded timestamps to Lisp timestamps and its API is now simpler.
I didn't follow your suggestion of adding another function that acts like current-time except it returns other Lisp timestamp formats, because (time-convert nil FORMAT) does that.
I didn't follow Stefan's suggestion of adding another function that acts like current-time except it returns the (TICKS . HZ) format, because current-time is already planned do exactly that after the next release (when we will default CURRENT_TIME_LIST to false) and it'll be simpler if we have one function rather than two that do the same thing.
[Prev in Thread] | Current Thread | [Next in Thread] |