(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
.
Deprecated:
This function only has a single arity and works for entities directly
convertible to java.time.Instant
. Please consider using java-date
instead.
Converts a date entity to a `java.util.Date`. *Deprecated*: This function only has a single arity and works for entities directly convertible to `java.time.Instant`. Please consider using `java-date` instead.
(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 local date entity to a java.sql.Date
.
Deprecated:
This function only has a single arity and works for entities directly
convertible to java.time.LocalDate
. Please consider using sql-date
instead.
Converts a local date entity to a `java.sql.Date`. *Deprecated*: This function only has a single arity and works for entities directly convertible to `java.time.LocalDate`. Please consider using `sql-date` instead.
(to-sql-timestamp o)
Converts a date entity to a java.sql.Timestamp
.
Deprecated:
This function only has a single arity and works for entities directly
convertible to java.time.Instant
. Please consider using sql-timestamp
instead.
Converts a date entity to a `java.sql.Timestamp`. *Deprecated*: This function only has a single arity and works for entities directly convertible to `java.time.Instant`. Please consider using `sql-timestamp` instead.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close