elisp: Time Calculations

 
 38.10 Time Calculations
 =======================
 
 These functions perform calendrical computations using time values
 (SeeTime of Day).  A value of ‘nil’ for any of their time-value
 arguments stands for the current system time, and a single integer
 number stands for the number of seconds since the epoch.
 
  -- Function: time-less-p t1 t2
      This returns ‘t’ if time value T1 is less than time value T2.
 
  -- Function: time-subtract t1 t2
      This returns the time difference T1 − T2 between two time values,
      as a time value.  If you need the difference in units of elapsed
      seconds, use ‘float-time’ (Seefloat-time Time of Day.) to
      convert the result into seconds.
 
  -- Function: time-add t1 t2
      This returns the sum of two time values, as a time value.  One
      argument should represent a time difference rather than a point in
      time, either as a list or as a single number of elapsed seconds.
      Here is how to add a number of seconds to a time value:
 
           (time-add TIME SECONDS)
 
  -- Function: time-to-days time-value
      This function returns the number of days between the beginning of
      year 1 and TIME-VALUE.
 
  -- Function: time-to-day-in-year time-value
      This returns the day number within the year corresponding to
      TIME-VALUE.
 
  -- Function: date-leap-year-p year
      This function returns ‘t’ if YEAR is a leap year.