                           "32" months
                           "16" sixteens
                           "8" eights)]
-    (period-func (epoch) date)))
+    (period-func (time/epoch) date)))
 
 (defn datetime->period
   "Converts a datestring, formatted as `YYYY-MM-DD`, into an integer

(defn in-days
  "Returns the number of days spanned by the given time interval."
  [interval]
  (let [mins (in-minutes interval)
        hours (/ mins 60)
        days (/ hours 24)]
    (int days)))

(defn julian
  "Returns the julian day index of a given date."
  [a]
  (in-days
   (interval (date-time (year a))
             a)))

;; the julian function complements the other "date-piece" functions

  in span-sized groups of unit (months or julians). [unit span] could be
  [julian 16], for example."
  [unit span start end]
  (let [[years units] (map #(delta % start end) [time/year unit])]
    (+ (* years (per-year unit span))
       (quot units span))))

