(autoload 'parse-time-string "parse-time")
(autoload 'timezone-make-date-arpa-standard "timezone")
-;;;###autoload
;; `parse-time-string' isn't sufficiently general or robust. It fails
;; to grok some of the formats that timezone does (e.g. dodgy
;; post-2000 stuff from some Elms) and either fails or returns bogus
;; values. timezone-make-date-arpa-standard should help.
+
+;;;###autoload
(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."
(apply 'signal err)
(error "Invalid date: %s" date)))))))))
-;; Bit of a mess. Emacs has float-time since at least 21.1.
-;; This file is synced to Gnus, and XEmacs packages may have been written
-;; using time-to-seconds from the Gnus library.
-;;;###autoload(if (or (featurep 'emacs)
-;;;###autoload (and (fboundp 'float-time)
-;;;###autoload (subrp (symbol-function 'float-time))))
-;;;###autoload (defalias 'time-to-seconds 'float-time)
-;;;###autoload (autoload 'time-to-seconds "time-date"))
-
-(eval-when-compile
- (or (featurep 'emacs)
- (and (fboundp 'float-time)
- (subrp (symbol-function 'float-time)))
- (defun time-to-seconds (&optional time)
- "Convert optional value TIME to a floating point number.
+;;; "Bit of a mess" is kind of an understatement --SY.
+;;; I'm blocking out the "mess" and not jumping through any autoload
+;;; cookie hoops to appease the Emacs Incompatibility Demons. This is
+;;; not likely to ever be sync'd back to GNU so it doesn't matter. --SY.
+;; ;; Bit of a mess. Emacs has float-time since at least 21.1.
+;; ;; This file is synced to Gnus, and XEmacs packages may have been written
+;; ;; using time-to-seconds from the Gnus library.
+;; ;;;###autoload(if (or (featurep 'emacs)
+;; ;;;###autoload (and (fboundp 'float-time)
+;; ;;;###autoload (subrp (symbol-function 'float-time))))
+;; ;;;###autoload (defalias 'time-to-seconds 'float-time)
+;; ;;;###autoload (autoload 'time-to-seconds "time-date"))
+
+;; (eval-when-compile
+;; (or (featurep 'emacs)
+;; (and (fboundp 'float-time)
+;; (subrp (symbol-function 'float-time)))
+;; (defun time-to-seconds (&optional time)
+;; "Convert optional value TIME to a floating point number.
+;; TIME defaults to the current time."
+;; (with-decoded-time-value ((high low micro pico _type
+;; (or time (current-time))))
+;; (+ (* high 65536.0)
+;; low
+;; (/ (+ (* micro 1e6) pico) 1e12))))))
+(eval-when-compile (defvar _type))
+;;;###autoload
+(defun time-to-seconds (&optional time)
+ "Convert optional value TIME to a floating point number.
TIME defaults to the current time."
(with-decoded-time-value ((high low micro pico _type
(or time (current-time))))
(+ (* high 65536.0)
low
- (/ (+ (* micro 1e6) pico) 1e12))))))
+ (/ (+ (* micro 1e6) pico) 1e12))))
+
+;;;###autoload(defalias 'float-time 'time-to-seconds)
;;;###autoload
(defun seconds-to-time (seconds)