Skip to content

Instantly share code, notes, and snippets.

@podviaznikov
Created June 11, 2013 00:45
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 podviaznikov/5753707 to your computer and use it in GitHub Desktop.
Save podviaznikov/5753707 to your computer and use it in GitHub Desktop.
Get day name from date represented as string in "YYYY-MM-DD" format.
(:require [clj-time.format :as clj-time-format]))
(defn get-day [date-str]
(let [date (clj-time-format/parse (clj-time-format/formatter "YYYY-MM-dd") date-str)
day (clj-time-format/unparse (clj-time-format/formatter "EEEE") date)]
day))
(get-day "2013-06-09")
"Monday"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment