You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Java Time API may seem daunting. Instead of a single <code>java.util.Date</code> you have a <code>ZonedDateTime</code>, <code>OffsetDateTime</code>, <code>LocalDateTime</code>, <code>Instant</code>, and other types. You would be well served by reading the official documentation for the <ahref="https://docs.oracle.com/javase/tutorial/datetime/iso/index.html">Java Time API</a>, but we’ll also do a quick run-through here.</p>
<p><code>LocalDate</code>, <code>LocalTime</code> and <code>LocalDateTime</code> are used to represent a date, time and date-time respectively without an offset or a timezone. The local time entities are used to represent human-based dates/times. They are a good fit for representing the time of various events:</p>
55
+
<p><code>LocalDate</code>, <code>LocalTime</code> and <code>LocalDateTime</code> are used to represent a date, time and date-time respectively without an offset or a time zone. The local time entities are used to represent human-based dates/times. They are a good fit for representing the time of various events:</p>
56
56
<ul>
57
57
<li><code>LocalDate</code> - birthday, holiday
58
58
<ul>
@@ -82,7 +82,7 @@ <h4><a href="#local-dates-andor-times" id="local-dates-andor-times"></a>Local Da
<p>There are two types which deal with zones: * <code>OffsetDateTime</code> * see <ahref="https://dm3.github.io/clojure.java-time/java-time.html#var-offset-date-time"><code>jt/offset-date-time</code></a> * <code>ZonedDateTime</code> * see <ahref="https://dm3.github.io/clojure.java-time/java-time.html#var-zoned-date-time"><code>jt/zoned-date-time</code></a></p>
85
-
<p>They do pretty much what you would expect from their name. You can think of the <code>Offset</code> time as a more concrete version of the <code>Zoned</code> time. For example, the same timezone can have different offsets throughout the year due to DST or governmental regulations.</p>
85
+
<p>They do pretty much what you would expect from their name. You can think of the <code>Offset</code> time as a more concrete version of the <code>Zoned</code> time. For example, the same time zone can have different offsets throughout the year due to DST or governmental regulations.</p>
@@ -238,7 +238,7 @@ <h4><a href="#legacy-date-time-types" id="legacy-date-time-types"></a>Legacy Dat
238
238
(jt/java-date 50000)
239
239
;=> #inst "1970-01-01T00:00:50.000-00:00"
240
240
</code></pre>
241
-
<p>An instance of <code>java.util.Date</code> serves the same purpose as the new <code>java.time.Instant</code>. It’s a machine timestamp which isn’t aware of the timezone. Please, do not get confused by the way it is printed by the Clojure printer - the UTC timezone is applied during formatting.</p>
241
+
<p>An instance of <code>java.util.Date</code> serves the same purpose as the new <code>java.time.Instant</code>. It’s a machine timestamp which isn’t aware of the time zone. Please, do not get confused by the way it is printed by the Clojure printer - the UTC time zone is applied during formatting.</p>
242
242
<p>Sometimes you’ll have to work with the legacy <code>java.sql.{Date,Time,Timestamp}</code> types. The correspondence between the legacy types and the new Date-Time entities is as follows:</p>
0 commit comments