Skip to content

Instantly share code, notes, and snippets.

@crankyadmin
Created January 11, 2018 12:11
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 crankyadmin/a3db5b5429dde419aff87a0875f259e1 to your computer and use it in GitHub Desktop.
Save crankyadmin/a3db5b5429dde419aff87a0875f259e1 to your computer and use it in GitHub Desktop.
(defn parse-second
""
[time-string]
(str (time/second (time-coerce/from-string time-string))))
(defn parse-minute
""
[time-string]
(str (time/minute (time-coerce/from-string time-string))))
(defn parse-hour
"Given time string => '2017-12-26T11:59:50.018+0000' will return 11"
[time-string]
(str (time/hour (time-coerce/from-string time-string))))
(defn parse-day
""
[time-string]
(str (time/day (time-coerce/from-string time-string))))
(defn parse-month
""
[time-string]
(str (time/month (time-coerce/from-string time-string))))
(defn parse-year
""
[time-string]
(str (time/year (time-coerce/from-string time-string))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment