(as-map e)(as-map e value-fn)Converts a time entity to a map of property key -> value as defined by the
passed in value-fn. By default the actual value of the unit/field is
produced.
(as-map (duration)) => {:nanos 0, :seconds 0}
(as-map (local-date 2015 1 1)) => {:year 2015, :month-of-year 1, :day-of-month 1, ...}
Converts a time entity to a map of property key -> value as defined by the
passed in `value-fn`. By default the actual value of the unit/field is
produced.
(as-map (duration))
=> {:nanos 0, :seconds 0}
(as-map (local-date 2015 1 1))
=> {:year 2015, :month-of-year 1, :day-of-month 1, ...}(convert-amount amount from-unit to-unit)Converts an amount from one unit to another. Returns a map of:
:whole - the whole part of the conversion in the to unit:remainder - the remainder in the from unitArguments may be keywords or instances of TemporalUnit.
Converts between precise units - nanos up to weeks, treating days as exact
multiples of 24 hours. Also converts between imprecise units - months up to
millenia. See ChronoUnit and IsoFields for all of the supported units.
Does not convert between precise and imprecise units.
Throws ArithmeticException if long overflow occurs during computation.
(convert-amount 10000 :seconds :hours) => {:remainder 2800 :whole 2}
Converts an amount from one unit to another. Returns a map of:
* `:whole` - the whole part of the conversion in the `to` unit
* `:remainder` - the remainder in the `from` unit
Arguments may be keywords or instances of `TemporalUnit`.
Converts between precise units - nanos up to weeks, treating days as exact
multiples of 24 hours. Also converts between imprecise units - months up to
millenia. See `ChronoUnit` and `IsoFields` for all of the supported units.
Does not convert between precise and imprecise units.
Throws `ArithmeticException` if long overflow occurs during computation.
(convert-amount 10000 :seconds :hours)
=> {:remainder 2800 :whole 2}(to-java-date o)Converts a date entity to a java.util.Date.
Converts a date entity to a `java.util.Date`.
(to-millis-from-epoch o)Converts a date entity to a long representing the number of milliseconds
from epoch.
Converts a date entity to a `long` representing the number of milliseconds from epoch.
(to-sql-date o)Converts a date entity to a java.sql.Date.
Converts a date entity to a `java.sql.Date`.
(to-sql-timestamp o)Converts a date entity to a java.sql.Timestamp.
Converts a date entity to a `java.sql.Timestamp`.
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 |