GNU Info

Info Node: (emacs-mime)time-date

(emacs-mime)time-date


Next: qp Prev: rfc2047 Up: Basic Functions
Enter node , (file) or (file)node

time-date
=========

   While not really a part of the MIME library, it is convenient to
document this library here.  It deals with parsing `Date' headers and
manipulating time.  (Not by using tesseracts, though, I'm sorry to say.)

   These functions convert between five formats: a date string, an Emacs
time structure, a decoded time list, a number of seconds, and a day
number.

   The functions have quite self-explanatory names, so the following
just gives an overview of which functions are available.

     (parse-time-string "Sat Sep 12 12:21:54 1998 +0200")
     => (54 21 12 12 9 1998 6 nil 7200)
     
     (date-to-time "Sat Sep 12 12:21:54 1998 +0200")
     => (13818 19266)
     
     (time-to-seconds '(13818 19266))
     => 905595714.0
     
     (seconds-to-time 905595714.0)
     => (13818 19266 0)
     
     (time-to-day '(13818 19266))
     => 729644
     
     (days-to-time 729644)
     => (961933 65536)
     
     (time-since '(13818 19266))
     => (0 430)
     
     (time-less-p '(13818 19266) '(13818 19145))
     => nil
     
     (subtract-time '(13818 19266) '(13818 19145))
     => (0 121)
     
     (days-between "Sat Sep 12 12:21:54 1998 +0200"
                   "Sat Sep 07 12:21:54 1998 +0200")
     => 5
     
     (date-leap-year-p 2000)
     => t
     
     (time-to-day-in-year '(13818 19266))
     => 255

   And finally, we have `safe-date-to-time', which does the same as
`date-to-time', but returns a zero time if the date is syntactically
malformed.


automatically generated by info2www version 1.2.2.9