Liking cljdoc? Tell your friends :D

cljs-time.coerce

Utilites to coerce goog.date DateTime instances to and from

various other types.

For example, to convert a goog.date DateTime to and from a js number:

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

=> (from-long 893462400000)
#<19980425T000000>
### Utilites to coerce goog.date DateTime instances to and from
  various other types.

  For example, to convert a goog.date DateTime to and from a js number:

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

=> (from-long 893462400000)
#<19980425T000000>
```
raw docstring

from-datecljs

(from-date date)

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

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

from-longcljs

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

(from-string s)

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

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

ICoercecljsprotocol

to-date-timecljs

(to-date-time obj)

Convert obj to a goog.date.DateTime instance.

Convert `obj` to a goog.date.DateTime instance.
source

to-datecljs

(to-date obj)

Convert obj to a JavaScript Date instance.

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

to-epochcljs

(to-epoch obj)

Convert obj to Unix epoch.

Convert `obj` to Unix epoch.
sourceraw docstring

to-local-datecljs

(to-local-date obj)

Convert obj to a goog.date.Date instance

Convert `obj` to a goog.date.Date instance
sourceraw docstring

to-local-date-timecljs

(to-local-date-time obj)

Convert obj to a goog.date.DateTime instance

Convert `obj` to a goog.date.DateTime instance
sourceraw docstring

to-longcljs

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

(to-string obj)

Returns a string representation of obj in UTC time-zone using "yyyy-MM-dd'T'HH:mm:ss.SSSZZ" date-time representation.

Returns a string representation of obj in UTC time-zone
using "yyyy-MM-dd'T'HH:mm:ss.SSSZZ" date-time representation.
sourceraw docstring

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

× close