Skip to content

Instantly share code, notes, and snippets.

@kencoba
Created March 10, 2011 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kencoba/863639 to your computer and use it in GitHub Desktop.
Save kencoba/863639 to your computer and use it in GitHub Desktop.
output sequense of palindrome date-time
(comment
this code uses http://clojars.org/clj-time.)
(ns palindrome-date-time.core
(:require [clj-time.core :as t])
(:require [clj-time.format :as f]))
(def custom-formatter (f/formatter "yyyyMMdd"))
(defn date-seq [d]
(lazy-seq
(cons (f/unparse custom-formatter d)
(date-seq (t/plus d (t/days 1))))))
(for [d (date-seq (t/date-time 1 1 1))
:while (= (count d) 8)
:when (= d (apply str (reverse d)))]
d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment