Skip to content

Instantly share code, notes, and snippets.

@ideal-knee
Last active August 29, 2015 13:56
Show Gist options
  • Save ideal-knee/9263175 to your computer and use it in GitHub Desktop.
Save ideal-knee/9263175 to your computer and use it in GitHub Desktop.
(parse (formatter "MMddyyyy") (str "0102" (year (now))))
; => #<DateTime 2014-01-02T00:00:00.000Z>
(minus (parse (formatter "MMddyyyy") (str "0102" (year (now)))) (years 1))
; => #<DateTime 2013-01-02T00:00:00.000Z>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment