Java Time API with Clojure

Open
#408 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
clojure, java
Domain
documentation

Research direction

Start with the Practicalli Clojure syntax page at practical.li/clojure/reference/clojure-syntax/more-java-fun.html and the Reference > Standard Library section. Review tick, cljc.java-time, time-literals, and clojure.java-time, then add the Date Time section with the requested examples, comparisons, dependency guidance, and selection summary. Done means the reference explains direct Java Time API use and the relevant library choices.

Written by the indexing model from the issue text.

Description

Projects
Deprecated projects
  • clj-time/clj-time
  • joda-time (used as the basis for Java TIme API) - deprecated since Java 8 introduced the Java Time API
References
Practicalli pages to update

https://practical.li/clojure/reference/clojure-syntax/more-java-fun.html

TODO: Add Date Time section to Reference > Standard Library section

  • use juxt/tick as the defacto library for both Clojure and ClojureScript projects (tick uses cljc.java-time under the hood)
  • add any meaningful comparisions to using cljc.java-time or juxt/tick
  • examples of using Clojure.java-time and Java Time API
    • using Java Time API directly removed the need for a library dependency
  • summary of why to choose one of the mentioned projects
clojure.java-time example

Add clojure.java-time to project deps.edn file

{:paths ["src"]
 :deps {org.clojure/clojure {:mvn/version "1.10.1"}
            clojure.java-time {:mvn/version "0.3.2"}}}

Require java-time namespace.
call local-date-time to get the date and time when the function was called

(ns practicalli.what-time-is-it
  (:require [java-time :as time]))

(defn -main []
  (println "The time according to Clojure java-time is:"
           (time/local-date-time)))
Dominant language
Makefile
Stars
117
Forks
36
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from practicalli/clojure

All issues in practicalli/clojure

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.