Skip to content

Latest commit

 

History

59 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jolt-lang/time

Date and time for jolt via juxt/tick.

The library provides the java.time.* surface (Instant, LocalDate, ZonedDateTime, Duration, DateTimeFormatter, …) as a pure-Clojure host shim, then pulls tick and cljc.java-time through deps.edn to expose tick's idiomatic Clojure API on top. Requiring it installs the shim and gives you the tick API. Needs jolt v0.8.2 or newer.

Use

;; deps.edn
{:deps {io.github.jolt-lang/time {:git/url "https://github.com/jolt-lang/time.git"
                                  :git/sha "abeee49974c2c4efa2fa75c96d9a379822c6815f"}}}
(require '[tick.core :as t])
(t/now)
(t/>> (t/date "2020-01-01") (t/new-period 3 :months))

Native libraries and time zones

This library declares no shared libraries of its own — there is no :jolt/native entry in deps.edn, and nothing extra to install. It runs on jolt's built-in host primitives.

Named IANA zones (America/New_York, Europe/Paris, …) have their offset resolved by the core jolt.host/tz-offset-seconds primitive, which the jolt host implements over libc. If that primitive is unavailable, those zones fall back to a built-in DST rule table covering the US, EU, AU, and NZ families. Fixed offsets (Z, +05:30) resolve purely in Clojure and never touch libc.

Loading the library also registers the machine's zone as jolt core's default zone (through jolt.host/set-default-zone-provider!), so TimeZone/getDefault, a zone-less SimpleDateFormat and ZoneId/systemDefault name one zone. Core on its own reads no system file for this and answers TZ or UTC.

Test

jolt -M:test

Runs tick's own suite plus the migrated jolt java.time cases. tick, spec.alpha, and the time-literals data-reader glue are vendored under vendor/ so the gate is self-contained.

About

A Jolt library for dealing with time

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages