(all-supported-fields temporal-accessor)Returns a map of supported temporal field lisp-style name -> value, e.g.
(parse-special-case (.parse (b/formatter (b/value :year 4) (b/value :iso/week-of-year 2)) "201901")) ;; -> {:year 2019, :iso-week-of-year 1}
Returns a map of supported temporal field lisp-style name -> value, e.g.
(parse-special-case (.parse
(b/formatter
(b/value :year 4)
(b/value :iso/week-of-year 2))
"201901"))
;; -> {:year 2019, :iso-week-of-year 1}(parse s)(parse formatter s)Parse almost any temporal literal String to a java.time object.
(second-date/parse "2020-04") ;; -> #object[java.time.LocalDate 0x1998e54f "2020-04-01"]
(second-date/parse "2020-04-01") ;; -> #object[java.time.LocalDate 0x1998e54f "2020-04-01"]
(second-date/parse "2020-04-01T15:01") ;; -> #object[java.time.LocalDateTime 0x121829b7 "2020-04-01T15:01"]
(second-date/parse "2020-04-01T15:01-07:00") ;; -> #object[java.time.OffsetDateTime 0x7dc126b0 "2020-04-01T15:01-07:00"]
(second-date/parse "2020-04-01T15:01-07:00[US/Pacific]") ;; -> #object[java.time.ZonedDateTime 0x351fb7c8 "2020-04-01T15:01-07:00[US/Pacific]"]
Parse almost any temporal literal String to a `java.time` object. (second-date/parse "2020-04") ;; -> #object[java.time.LocalDate 0x1998e54f "2020-04-01"] (second-date/parse "2020-04-01") ;; -> #object[java.time.LocalDate 0x1998e54f "2020-04-01"] (second-date/parse "2020-04-01T15:01") ;; -> #object[java.time.LocalDateTime 0x121829b7 "2020-04-01T15:01"] (second-date/parse "2020-04-01T15:01-07:00") ;; -> #object[java.time.OffsetDateTime 0x7dc126b0 "2020-04-01T15:01-07:00"] (second-date/parse "2020-04-01T15:01-07:00[US/Pacific]") ;; -> #object[java.time.ZonedDateTime 0x351fb7c8 "2020-04-01T15:01-07:00[US/Pacific]"]
(parse-with-formatter formattr s)Parse a String with a DateTimeFormatter, returning an appropriate instance of an java.time temporal class.
Parse a String with a DateTimeFormatter, returning an appropriate instance of an `java.time` temporal class.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |