Created
April 16, 2015 10:41
-
-
Save firesofmay/c6038da876065c63076d to your computer and use it in GitHub Desktop.
Convert datetime to weekyear-week
This file contains hidden or 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
(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