X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Ftime-date.el;h=558bc3c7b301efc31257206aa3e97fdf6e4822fb;hb=7d360ad9b65c2c51068117c290ebba043fe5924e;hp=c40ddbead30f91b8ed78325bf907f2bc3416045d;hpb=daea6bb7f5bda46077dabaf7a2ab4450df400fa7;p=elisp%2Fgnus.git- diff --git a/lisp/time-date.el b/lisp/time-date.el index c40ddbe..558bc3c 100644 --- a/lisp/time-date.el +++ b/lisp/time-date.el @@ -1,8 +1,10 @@ ;;; time-date.el --- Date and time handling functions -;; Copyright (C) 1998,99 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Masanobu Umeda +;; Keywords: mail news util + ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify @@ -24,8 +26,11 @@ ;;; Code: +(eval-when-compile (require 'cl)) + (require 'parse-time) +;;;###autoload (defun date-to-time (date) "Convert DATE into time." (condition-case () @@ -36,7 +41,7 @@ "Convert TIME to a floating point number." (+ (* (car time) 65536.0) (cadr time) - (/ (or (caddr time) 0) 1000000.0))) + (/ (or (nth 2 time) 0) 1000000.0))) (defun seconds-to-time (seconds) "Convert SECONDS (a floating point number) to an Emacs time structure." @@ -116,6 +121,7 @@ The Gregorian date Sunday, December 31, 1bce is imaginary." (- (/ (1- year) 100)) ; - century years (/ (1- year) 400)))) ; + Gregorian leap years +;;;###autoload (defun safe-date-to-time (date) "Parse DATE and return a time structure. If DATE is malformed, a zero time will be returned."