 (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)))
+  (-> interval time/in-minutes (/ 60) (/ 24) int))
 
 (defn julian
   "Returns the julian day index of a given date."
   [a]
   (in-days
-   (interval (date-time (year a))
+   (time/interval (date-time (year a))
              a)))
 
 ;; the julian function complements the other "date-piece" functions

;; proper temporal comparison of two unrelated datasets.

(ns forma.date-time
  (:use [clj-time.core :only (now epoch date-time year month
                                  plus in-msecs in-minutes
                                  interval)]
        [clj-time.format :only (unparse formatters)]
        [clojure.string :only (split)]
        [clojure.contrib.math :only (ceil)]))

;; ### Reference Time
;;

                          "32" months
                          "16" sixteens
                          "8" eights)]
    (period-func (time/epoch) date)))

(defn datetime->period
  "Converts a datestring, formatted as `YYYY-MM-DD`, into an integer
