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>
raw docstring

from-dateclj

(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-epochclj

(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-longclj

(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-dateclj

(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-timeclj

(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-stringclj

(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

ICoercecljprotocol

to-date-timeclj

(to-date-time obj)

Convert obj to a Joda DateTime instance.

Convert `obj` to a Joda DateTime instance.
source

in-time-zoneclj

(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-dateclj

(to-date obj)

Convert obj to a Java Date instance.

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

to-epochclj

(to-epoch obj)

Convert obj to Unix epoch.

Convert `obj` to Unix epoch.
sourceraw docstring

to-local-dateclj

(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-timeclj

(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-longclj

(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-dateclj

(to-sql-date obj)

Convert obj to a java.sql.Date instance.

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

to-sql-timeclj

(to-sql-time obj)

Convert obj to a java.sql.Timestamp instance.

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

to-stringclj

(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-timestampclj

(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