unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19302: 24.4.51; `date-to-time' fails after 2038
@ 2014-12-08  1:58 Gabriel
  2014-12-08  3:59 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 38+ messages in thread
From: Gabriel @ 2014-12-08  1:58 UTC (permalink / raw)
  To: 19302

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Doc fix patch to `date-to-time' --]
[-- Type: text/x-diff, Size: 1436 bytes --]

From c90da02532e7025d6f73f288244f487c77ab9538 Mon Sep 17 00:00:00 2001
From: Gabriel Beauchamp <beauchampgabriel@gmail.com>
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 <beauchampgabriel@gmail.com>
+
+	* calendar/time-date.el (date-to-time): Doc fix.
+
 2014-12-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* 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


^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2020-03-09  0:10 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08  1:58 bug#19302: 24.4.51; `date-to-time' fails after 2038 Gabriel
2014-12-08  3:59 ` Lars Magne Ingebrigtsen
2014-12-08 12:54   ` Gabriel
2014-12-08 20:59   ` Richard Stallman
2014-12-08 22:02     ` Lars Magne Ingebrigtsen
2014-12-09 11:01       ` Richard Stallman
2014-12-09 16:38         ` Eli Zaretskii
2014-12-09 18:17           ` Ivan Shmakov
2014-12-09 18:26             ` Eli Zaretskii
2014-12-09 18:31               ` Lars Magne Ingebrigtsen
2014-12-09 18:49                 ` Eli Zaretskii
2014-12-09 19:01                   ` Lars Magne Ingebrigtsen
2014-12-09 19:09                     ` Eli Zaretskii
2014-12-10  0:41                       ` Gabriel
2014-12-10 16:25                         ` Eli Zaretskii
2014-12-11  0:31                           ` bug#19302: [PATCH] " Gabriel
2014-12-11  9:25                             ` Andreas Schwab
2014-12-09 20:52                     ` Andreas Schwab
2014-12-09 19:07                   ` Ivan Shmakov
2014-12-09 19:48                     ` Eli Zaretskii
2014-12-10 16:18                 ` Richard Stallman
2014-12-10 21:21                   ` Gabriel
2014-12-11 19:49                     ` Richard Stallman
2014-12-12  0:33                       ` Gabriel
2014-12-10 16:18           ` Richard Stallman
2014-12-10  0:37         ` Stefan Monnier
2014-12-10 16:17           ` Richard Stallman
2014-12-10 19:59             ` Stefan Monnier
2014-12-11 19:49               ` Richard Stallman
2014-12-11 20:31                 ` Stefan Monnier
2014-12-12 16:42                   ` Richard Stallman
2019-11-02  0:11                   ` Stefan Kangas
2020-02-29 18:17                   ` Stefan Kangas
2020-02-29 20:06                     ` Stefan Monnier
2020-03-01  1:30                       ` Stefan Kangas
2020-03-01  3:56                         ` Stefan Monnier
2020-03-02 10:43                           ` Stefan Kangas
2020-03-09  0:10                           ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).