   (:require [appengine-magic.core :as ae]
             [appengine-magic.services.datastore :as ds]
             [clojure.contrib.str-utils2 :as s])
-  (:import com.google.appengine.api.datastore.EntityNotFoundException))
+  (:import com.google.appengine.api.datastore.EntityNotFoundException
+           java.text.SimpleDateFormat
+           java.util.Date))
 
 (ds/defentity Page [^:key url, title, body, timestamp])
 

     [:div [:h1 (:title page)]
      [:div (:body page)]])))

(defn render-paginate
  "Renders a fixed number of pages"
  [number]

  (response-wrapper
   "Paginated"
   (html (for [page pages]
           [:div {:class "post"} [:h1 {:class "title"} (page-link page)]
            [:div {:class "date"} (to-date (:timestamp page))]
            (:body page)])
         (if (> number 0)
           (html (link-to (str "/pages/" (dec number)) "prev") [:br]))
         (if (= pagesize (count pages))
