Created
March 10, 2011 05:57
-
-
Save kencoba/863639 to your computer and use it in GitHub Desktop.
output sequense of palindrome date-time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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