Manipulating time with clj-time
Learn to manipulate time with ease in Clojure
Manipulating time is a difficult thing. Time was made for people. The rules are complicated and depend on where you are on Earth. Time units have varying lengths (how long is "one month"?; how long is a day when you change daylight savings?), daylight savings depends on the country you're in, and formatting dates depends on the language. It's complicated. Luckily, Joda Time does an excellent job. Joda Time is a date-time library that represents everything immutably. It's what people use when they want robust date-time calculations. clj-time wraps up the types from Joda Time and makes it easy to use from Clojure. cljs-time is a ClojureScript implementation that has an identical API.
In this section, we go through the major use cases of times and dates and time zones, how you represent each one, the operations you will likely perform on them, and other practical considerations. We don't touch on everything, but you get the major concepts and confidence to go through the docs for yourself.
7 Lessons