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

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

bug#19302: 24.4.51; `date-to-time' fails after 2038


From: Gabriel
Subject: bug#19302: 24.4.51; `date-to-time' fails after 2038
Date: Sun, 07 Dec 2014 20:58:36 -0500

The function `date-to-time' will fail if the argument if after
19-Jan-2038 03:14:07 GMT.

It doesn't seem documented everywhere (unless the 'Year 2038 problem' is
assumed knowledge).

I don't think I can actually fix it. But I wrote a little patch to at
least make it clear in the doc string.

>From c90da02532e7025d6f73f288244f487c77ab9538 Mon Sep 17 00:00:00 2001
From: Gabriel Beauchamp <address@hidden>
Date: Sun, 7 Dec 2014 20:46:30 -0500
Subject: [PATCH] calendar/time-date.el (date-to-time): Doc fix.

---
 lisp/ChangeLog             | 4 ++++
 lisp/calendar/time-date.el | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a1d60d1..30e704f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-08  Gabriel Beauchamp <address@hidden>
+
+       * calendar/time-date.el (date-to-time): Doc fix.
+
 2014-12-07  Lars Magne Ingebrigtsen  <address@hidden>
 
        * net/eww.el (eww-follow-link): Revert prefix behaviour to
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index e7a8cc7..4e67adc 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -146,7 +146,9 @@ it is assumed that PICO was omitted and should be treated 
as zero."
 ;; values.  timezone-make-date-arpa-standard should help.
 (defun date-to-time (date)
   "Parse a string DATE that represents a date-time and return a time value.
-If DATE lacks timezone information, GMT is assumed."
+If DATE lacks timezone information, GMT is assumed.
+If DATE is after 19-Jan-2038 03:14:07 GMT, `date-to-time' will fail
+and raise an error."
   (condition-case err
       (apply 'encode-time (parse-time-string date))
     (error
-- 
1.8.3.2


reply via email to

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