Public Vars
- *clock* (clj)
- *time-literals-printing* (clj)
- + (clj)
- - (clj)
- ->AtomicClock (clj)
- ->FieldsLookup (clj)
- < (clj)
- << (clj)
- <= (clj)
- = (clj)
- > (clj)
- >= (clj)
- >> (clj)
- APRIL (clj)
- AUGUST (clj)
- AtomicClock (clj)
- DECEMBER (clj)
- FEBRUARY (clj)
- FRIDAY (clj)
- FieldsLookup (clj)
- JANUARY (clj)
- JULY (clj)
- JUNE (clj)
- MARCH (clj)
- MAY (clj)
- MONDAY (clj)
- NOVEMBER (clj)
- OCTOBER (clj)
- SATURDAY (clj)
- SEPTEMBER (clj)
- SUNDAY (clj)
- THURSDAY (clj)
- TUESDAY (clj)
- UTC (clj)
- WEDNESDAY (clj)
- ago (clj)
- at (clj)
- atom (clj)
- backward-compatible-time-span-extensions (clj)
- beginning (clj)
- between (clj)
- clock (clj)
- clock? (clj)
- coincident? (clj)
- compare-and-set! (clj)
- current-clock (clj)
- current-zone (clj)
- date (clj)
- date-time (clj)
- date-time? (clj)
- date? (clj)
- day-of-month (clj)
- day-of-week (clj)
- day-of-week-in-month (clj)
- day-of-week? (clj)
- days (clj)
- dec (clj)
- divide (clj)
- duration (clj)
- duration? (clj)
- end (clj)
- epoch (clj)
- field-map (clj)
- fields (clj)
- first-day-of-month (clj)
- first-day-of-next-month (clj)
- first-day-of-next-year (clj)
- first-day-of-year (clj)
- first-in-month (clj)
- format (clj)
- formatter (clj)
- greater (clj)
- hence (clj)
- hour (clj)
- hours (clj)
- in (clj)
- inc (clj)
- inst (clj)
- instant (clj)
- instant? (clj)
- int (clj)
- interval? (clj)
- last-day-of-month (clj)
- last-day-of-year (clj)
- last-in-month (clj)
- lesser (clj)
- long (clj)
- map->AtomicClock (clj)
- max (clj)
- max-key (clj)
- max-of-type (clj)
- micros (clj)
- microsecond (clj)
- midnight (clj)
- midnight? (clj)
- millis (clj)
- millisecond (clj)
- min (clj)
- min-key (clj)
- min-of-type (clj)
- minute (clj)
- minutes (clj)
- modify-printing-of-time-literals-if-enabled! (clj)
- month (clj)
- month? (clj)
- months (clj)
- nanos (clj)
- nanosecond (clj)
- negated (clj)
- new-date (clj)
- new-duration (clj)
- new-period (clj)
- new-time (clj)
- new-year-month (clj)
- next (clj)
- next-or-same (clj)
- noon (clj)
- now (clj)
- of-days (clj)
- of-hours (clj)
- of-micros (clj)
- of-millis (clj)
- of-minutes (clj)
- of-months (clj)
- of-nanos (clj)
- of-seconds (clj)
- of-years (clj)
- offset-by (clj)
- offset-date-time (clj)
- offset-date-time? (clj)
- on (clj)
- parse-date (clj)
- parse-date-time (clj)
- parse-day (clj)
- parse-month (clj)
- parse-offset-date-time (clj)
- parse-time (clj)
- parse-year (clj)
- parse-year-month (clj)
- parse-zoned-date-time (clj)
- period? (clj)
- predefined-formatters (clj)
- previous (clj)
- previous-or-same (clj)
- range (clj)
- reset! (clj)
- reset-vals! (clj)
- reverse-unit-map (clj)
- second (clj)
- seconds (clj)
- swap! (clj)
- swap-vals! (clj)
- tick-resolution (clj)
- time (clj)
- time? (clj)
- today (clj)
- tomorrow (clj)
- truncate (clj)
- unit-map (clj)
- units (clj)
- with (clj)
- with-clock (clj)
- year (clj)
- year-month (clj)
- year-month? (clj)
- year? (clj)
- years (clj)
- yesterday (clj)
- zone (clj)
- zone-offset (clj)
- zone-offset? (clj)
- zone? (clj)
- zoned-date-time (clj)
- zoned-date-time? (clj)
Back
epoch (clj)
(source)function
(epoch)
Constant for the 1970-01-01T00:00:00Z epoch instant
Examples
tick
(ns tick.api-test
(:require
[clojure.test
:refer [deftest is testing run-tests]
:refer-macros [deftest is testing run-tests]]
[tick.core :as t]
[tick.locale-en-us]
[tick.protocols :as p]
[cljc.java-time.clock]
[cljc.java-time.instant]
[cljc.java-time.day-of-week]
[cljc.java-time.month]
[cljc.java-time.year]
#?@(:cljs [[java.time :refer [Instant]]]))
#?(:clj
(:import [java.time Instant])))
(deftest constructor-test
(is (t/year? (t/year 2017)))
(is (= 2017 (cljc.java-time.year/get-value (t/year 2017))))
(is (t/month? (t/month 12)))
(is (= t/DECEMBER (t/month 12)))
(is (= (t/new-date 3030 3 3)
(t/date "3030-03-03")))
(is (-> (t/new-duration 1000 :millis)
(t/inst)
(t/instant)
(cljc.java-time.instant/to-epoch-milli)
(= 1000)))
(is (= (t/new-year-month 2020 7)
(t/year-month "2020-07"))))
(deftest epoch-test
(is (= (cljc.java-time.instant/parse "1970-01-01T00:00:00Z") (t/epoch))))