44
55A Clojure wrapper for Java 8 Date-Time API.
66
7+ > Note: This library has no relation Clojure's (or Java's) core team.
8+ > It's naming is legacy and preserved for backwards compatibility reasons.
9+
710## Rationale
811
912Main goals:
@@ -38,7 +41,7 @@ is purely on the merits of a broader feature set.
3841
3942## Documentation
4043
41- * [ API] ( http ://dm3.github.io/clojure.java-time/)
44+ * [ API] ( https ://dm3.github.io/clojure.java-time/)
4245* [ ![ cljdoc badge] ( https://cljdoc.org/badge/clojure.java-time/clojure.java-time )] ( https://cljdoc.org/d/clojure.java-time/clojure.java-time/CURRENT )
4346
4447## What's different in Java Time API?
@@ -50,9 +53,9 @@ complicated than it has to be. Also, a few concepts have faulty designs which
5053lead to hard to fix bugs and misuse. You can see the birds-eye view of changes
5154and some of the rationale on the author's (Stephen Colebourne) blog:
5255
53- * [ what's wrong with Joda-Time] ( http ://blog.joda.org/2009/11/why-jsr-310-isn-joda-time_4941.html) ,
54- * [ when you should use Java-Time] ( http ://blog.joda.org/2014/07/threeten-backport-vs-joda-time.html)
55- * [ what's different in Java-Time] ( http ://blog.joda.org/2014/11/converting-from-joda-time-to-javatime.html) .
56+ * [ what's wrong with Joda-Time] ( https ://blog.joda.org/2009/11/why-jsr-310-isn-joda-time_4941.html) ,
57+ * [ when you should use Java-Time] ( https ://blog.joda.org/2014/07/threeten-backport-vs-joda-time.html)
58+ * [ what's different in Java-Time] ( https ://blog.joda.org/2014/11/converting-from-joda-time-to-javatime.html) .
5659
5760You can also take a look at a [ comprehensive comparison] ( http://time4j.net/tutorial/appendix.html ) by the
5861[ Time4J] ( http://time4j.net/ ) authors.
@@ -61,28 +64,28 @@ You can also take a look at a [comprehensive comparison](http://time4j.net/tutor
6164
6265Add the following dependency to your ` deps.edn `
6366``` clj
64- clojure.java-time/clojure.java-time {:mvn/version " 0.3.3 " }
67+ clojure.java-time/clojure.java-time {:mvn/version " 1.0.0 " }
6568```
6669
6770or to your ` project.clj ` or ` build.boot ` :
6871
6972``` clj
70- [clojure.java-time " 0.3.3 " ]
73+ [clojure.java-time " 1.0.0 " ]
7174```
7275
7376The [ API] ( https://dm3.github.io/clojure.java-time/ ) of the Clojure.Java-Time
74- consists of one namespace, namely ` java-time ` . For the purposes of this guide,
77+ consists of one namespace, namely ` java-time.api ` . For the purposes of this guide,
7578we will ` require ` the main namespace:
7679
7780``` clj
78- (require '[java-time :as jt]
81+ (require '[java-time.api :as jt]
7982 ; ; for REPL experimentation
8083 'java-time.repl)
8184```
8285
8386### Concept run-through
8487
85- Java Time API may seem daunting. Instead of a single ` java.util.Date ` you have
88+ The Java Time API may seem daunting. Instead of a single ` java.util.Date ` you have
8689a ` ZonedDateTime ` , ` OffsetDateTime ` , ` LocalDateTime ` , ` Instant ` , and other
8790types. You would be well served by reading the official documentation for the
8891[ Java Time API] ( https://docs.oracle.com/javase/tutorial/datetime/iso/index.html ) ,
@@ -96,11 +99,11 @@ are used to represent human-based dates/times. They are a good fit for represent
9699the time of various events:
97100
98101* ` LocalDate ` - birthday, holiday
99- * see [ ` jt/local-date ` ] ( http ://dm3.github.io/clojure.java-time/java-time.html#var-local-date)
102+ * see [ ` jt/local-date ` ] ( https ://dm3.github.io/clojure.java-time/java-time.api .html#var-local-date)
100103* ` LocalTime ` - bus schedule, opening time of a shop
101- * see [ ` jt/local-time ` ] ( http ://dm3.github.io/clojure.java-time/java-time.html#var-local-time)
104+ * see [ ` jt/local-time ` ] ( https ://dm3.github.io/clojure.java-time/java-time.api .html#var-local-time)
102105* ` LocalDateTime ` - start of a competition
103- * see [ ` jt/local-date-time ` ] ( http ://dm3.github.io/clojure.java-time/java-time.html#var-local-date-time)
106+ * see [ ` jt/local-date-time ` ] ( https ://dm3.github.io/clojure.java-time/java-time.api .html#var-local-date-time)
104107
105108Example usage:
106109
@@ -119,9 +122,9 @@ Example usage:
119122
120123There are two types which deal with zones:
121124* ` OffsetDateTime `
122- * see [ ` jt/offset-date-time ` ] ( https://dm3.github.io/clojure.java-time/java-time.html#var-offset-date-time )
125+ * see [ ` jt/offset-date-time ` ] ( https://dm3.github.io/clojure.java-time/java-time.api. html#var-offset-date-time )
123126* ` ZonedDateTime `
124- * see [ ` jt/zoned-date-time ` ] ( https://dm3.github.io/clojure.java-time/java-time.html#var-zoned-date-time )
127+ * see [ ` jt/zoned-date-time ` ] ( https://dm3.github.io/clojure.java-time/java-time.api. html#var-zoned-date-time )
125128
126129They do pretty much what you would expect from their name.
127130You can think of the ` Offset ` time as a more concrete version of the ` Zoned `
@@ -141,8 +144,8 @@ year due to DST or governmental regulations.
141144
142145Offset/Zone times only take the offset/zone as the last arguments for the
143146maximum arity constructor. You can influence the zone/offset by using the
144- [ ` jt/with-zone ` ] ( https://dm3.github.io/clojure.java-time/java-time.html#var-with-zone )
145- or [ ` jt/with-offset ` ] ( https://dm3.github.io/clojure.java-time/java-time.html#var-with-offset ) functions, like so:
147+ [ ` jt/with-zone ` ] ( https://dm3.github.io/clojure.java-time/java-time.api. html#var-with-zone )
148+ or [ ` jt/with-offset ` ] ( https://dm3.github.io/clojure.java-time/java-time.api. html#var-with-offset ) functions, like so:
146149
147150``` clj
148151(jt/with-zone (jt/zoned-date-time 2015 10 ) " UTC" )
0 commit comments