Skip to content

Cross-platform (clj/cljs) DateTime type coercion, parsing, and manipulation

Notifications You must be signed in to change notification settings

chbrown/era-clojure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

era

Travis CI Build Status Coverage Status Clojars Project

Cross-platform DateTime type coercion, parsing, and manipulation.

Supports Clojure and ClojureScript via reader conditionals, so it requires Clojure 1.7.0, [org.clojure/clojure "1.7.0"], or newer.

When compiled for the Clojure/Java platform, it uses the java.time.* API (a.k.a. JSR-310), so Java 8 is required.

Terminology

  • Timestamp (= Instant): a finite point in linear time, measurable in milliseconds since the epoch
  • Duration: an amount of linear time, measurable in milliseconds
  • Interval: two timestamps -- or a single timestamp plus a duration (and a single bit to say whether the timestamp is the beginning or the end)
  • Period: a semantic (non-linear) duration, like "2 weeks". This is a bit confusing, since the ISO-8601 prefix/indicator for duration syntax is "P", but it is used for duration, not period -- since you can only have hour, minute, and second values in that duration.

Alternatives

License

Copyright © 2017 Christopher Brown. Eclipse Public License - v 1.0.

About

Cross-platform (clj/cljs) DateTime type coercion, parsing, and manipulation

Resources

Stars

Watchers

Forks

Packages

No packages published