Liking cljdoc? Tell your friends :D

clj-time.coerce

Utilites to coerce Joda DateTime instances to and from various other types. For example, to convert a Joda DateTime to and from a Java long:

=> (to-long (date-time 1998 4 25)) 893462400000

=> (from-long 893462400000) #<DateTime 1998-04-25T00:00:00.000Z>

Utilites to coerce Joda DateTime instances to and from various other types.
For example, to convert a Joda DateTime to and from a Java long:

  => (to-long (date-time 1998 4 25))
  893462400000

  => (from-long 893462400000)
  #<DateTime 1998-04-25T00:00:00.000Z>

data-readers

tagged literal support if loader does not find "data_readers.clj"

tagged literal support if loader does not find "data_readers.clj"
sourceraw docstring

from-date

(from-date date)

Returns a DateTime instance in the UTC time zone corresponding to the given Java Date object.

Returns a DateTime instance in the UTC time zone corresponding to the given
Java Date object.
sourceraw docstring

from-epoch

(from-epoch epoch)

Returns a DateTime instance in the UTC time zone from given Unix epoch.

Returns a DateTime instance in the UTC time zone
from given Unix epoch.
sourceraw docstring

from-long

(from-long millis)

Returns a DateTime instance in the UTC time zone corresponding to the given number of milliseconds after the Unix epoch.

Returns a DateTime instance in the UTC time zone corresponding to the given
number of milliseconds after the Unix epoch.
sourceraw docstring

from-sql-date

(from-sql-date sql-date)

Returns a DateTime instance in the UTC time zone corresponding to the given java.sql.Date object.

Returns a DateTime instance in the UTC time zone corresponding to the given
java.sql.Date object.
sourceraw docstring

from-sql-time

(from-sql-time sql-time)

Returns a DateTime instance in the UTC time zone corresponding to the given java.sql.Timestamp object.

Returns a DateTime instance in the UTC time zone corresponding to the given
java.sql.Timestamp object.
sourceraw docstring

from-string

(from-string s)

return DateTime instance from string using formatters in clj-time.format, returning first which parses

return DateTime instance from string using
formatters in clj-time.format, returning first
which parses
sourceraw docstring

ICoerceprotocol

to-date-time
(to-date-time obj)

Convert obj to a Joda DateTime instance.

Convert `obj` to a Joda DateTime instance.

source

in-time-zone

(in-time-zone obj tz)

Convert obj into tz, return org.joda.time.LocalDate instance.

Convert `obj` into `tz`, return org.joda.time.LocalDate instance.
sourceraw docstring

to-date

(to-date obj)

Convert obj to a Java Date instance.

Convert `obj` to a Java Date instance.
sourceraw docstring

to-edn

(to-edn obj)

Convert obj to a string representation readable by clojure.edn/read.

Convert `obj` to a string representation readable by clojure.edn/read.
sourceraw docstring

to-epoch

(to-epoch obj)

Convert obj to Unix epoch.

Convert `obj` to Unix epoch.
sourceraw docstring

to-local-date

(to-local-date obj)

Convert obj to a org.joda.time.LocalDate instance

Convert `obj` to a org.joda.time.LocalDate instance
sourceraw docstring

to-local-date-time

(to-local-date-time obj)

Convert obj to a org.joda.time.LocalDateTime instance

Convert `obj` to a org.joda.time.LocalDateTime instance
sourceraw docstring

to-long

(to-long obj)

Convert obj to the number of milliseconds after the Unix epoch.

Convert `obj` to the number of milliseconds after the Unix epoch.
sourceraw docstring

to-sql-date

(to-sql-date obj)

Convert obj to a java.sql.Date instance.

Convert `obj` to a java.sql.Date instance.
sourceraw docstring

to-sql-time

(to-sql-time obj)

Convert obj to a java.sql.Timestamp instance.

Convert `obj` to a java.sql.Timestamp instance.
sourceraw docstring

to-string

(to-string obj)

Returns a string representation of obj in UTC time-zone using (ISODateTimeFormat/dateTime) date-time representation.

Returns a string representation of obj in UTC time-zone
using (ISODateTimeFormat/dateTime) date-time representation.
sourceraw docstring

to-timestamp

(to-timestamp obj)

Convert obj to a Java SQL Timestamp instance.

Convert `obj` to a Java SQL Timestamp instance.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close