Skip to content

Instantly share code, notes, and snippets.

@firesofmay
Created April 16, 2015 10:41
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 firesofmay/c6038da876065c63076d to your computer and use it in GitHub Desktop.
Save firesofmay/c6038da876065c63076d to your computer and use it in GitHub Desktop.
Convert datetime to weekyear-week
(do
(require '[clj-time.format :as f])
(require '[clj-time.core :as t])
(defn get-week
[dt]
(f/unparse (:weekyear-week f/formatters)
dt))
(println (get-week (t/now)))
(println (get-week (t/minus (t/now)
(t/days 30)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment