bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59506: 29.0.50; (time-since nil) return format change


From: Eli Zaretskii
Subject: bug#59506: 29.0.50; (time-since nil) return format change
Date: Wed, 23 Nov 2022 15:09:30 +0200

> Cc: 59506@debbugs.gnu.org
> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Wed, 23 Nov 2022 10:13:38 +0100
> 
> In most cases, nil is assumed to be the current time. `time-subtract' is 
> doing that here.

Adding Paul.  Paul, any comments?

> It could be "fixed" so
> 
> diff --git i/lisp/calendar/time-date.el w/lisp/calendar/time-date.el
> index bbdcaa4db4..27ce10d7d6 100644
> --- i/lisp/calendar/time-date.el
> +++ w/lisp/calendar/time-date.el
> @@ -200,5 +200,5 @@ time-since
>      ;; Convert date strings to internal time.
>      (setq time (date-to-time time)))
> -  (time-subtract nil time))
> +  (time-subtract nil (or time (current-time))))
>  
>  ;;;###autoload
> 
> but that would make the result inconsistent:
> 
> ELISP> (time-since nil)
> (0 0 0 0)
> 
> ELISP> (time-since nil)
> (0 0 1 0)
> 
> I'm not sure that's better. And you can always do 
> 
> (time-since (or time (current-time)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]