# How to use 'clj-time' to get current time by LocalDateTime?

**URL:** https://clojureverse.org/t/how-to-use-clj-time-to-get-current-time-by-localdatetime/11209
**Category:** Beginners
**Created:** [February 11, 2025, 8:41am UTC](https://clojureverse.org/t/how-to-use-clj-time-to-get-current-time-by-localdatetime/11209 "2025-02-11T08:41:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ninesolaries](https://clojureverse.org/user_avatar/clojureverse.org/ninesolaries/32/4456_2.png) [@ninesolaries](https://clojureverse.org/u/ninesolaries)
#### Post date: [February 11, 2025, 8:41am UTC](https://clojureverse.org/t/how-to-use-clj-time-to-get-current-time-by-localdatetime/11209/1 "2025-02-11T08:41:15Z")

</div>

> (require '[clj-time.local :as l])  
> (type (l/to-local-date-time (l/local-now)))  
> =\> org.joda.time.DateTime

but how to get the object by “org.joda.time.LocalDateTime”?

thank you.

---

<div class="post-metadata">

### Author: ![dave.liepmann](https://clojureverse.org/user_avatar/clojureverse.org/dave.liepmann/32/5211_2.png) [@dave.liepmann](https://clojureverse.org/u/dave.liepmann)
#### Post date: [February 11, 2025, 10:06am UTC](https://clojureverse.org/t/how-to-use-clj-time-to-get-current-time-by-localdatetime/11209/2 "2025-02-11T10:06:11Z")

</div>

> [@ninesolaries](#):
>
> (type (l/to-local-date-time (l/local-now)))

The issue seems to be described in [Please support custom format-local-time formats · Issue #131 · clj-time/clj-time · GitHub](https://github.com/clj-time/clj-time/issues/131)

> Basically the meaning of ‘local’ in the .local namespace is that those functions handle DateTime objects (with time zones) in the local time zone, while LocalDateTime is timezone-less DateTime.

Not sure if there’s something better than `(clj-time.coerce/to-local-date-time (clj-time.core/now))`.

---

<div class="post-metadata">

### Author: ![ninesolaries](https://clojureverse.org/user_avatar/clojureverse.org/ninesolaries/32/4456_2.png) [@ninesolaries](https://clojureverse.org/u/ninesolaries)
#### Post date: [February 11, 2025, 11:43pm UTC](https://clojureverse.org/t/how-to-use-clj-time-to-get-current-time-by-localdatetime/11209/3 "2025-02-11T23:43:59Z")

</div>

Thank you very much, now I understand.But still have risk of confusion by DateTime and LocalDateTime, so need I unparse the DateTime and parse it again to LocalDateTime for better?

---

<div class="post-metadata">

### Author: ![seancorfield](https://clojureverse.org/user_avatar/clojureverse.org/seancorfield/32/195_2.png) [@seancorfield](https://clojureverse.org/u/seancorfield)
#### Post date: [February 12, 2025, 3:03am UTC](https://clojureverse.org/t/how-to-use-clj-time-to-get-current-time-by-localdatetime/11209/4 "2025-02-12T03:03:19Z")

</div>

As the primary maintainer of `clj-time`, I’ll point out that it is **deprecated** and no longer maintained – and the README asks folks to either switch to Java Time directly with interop, or use one of two actively maintained alternatives.

---

<div class="post-metadata">

### Author: ![system](https://clojureverse.org/uploads/default/original/2X/5/51079bf9e4b7d9466242c06cf1e43b9f8bd6da14.png) [@system](https://clojureverse.org/u/system)
#### Post date: [August 13, 2025, 3:04pm UTC](https://clojureverse.org/t/how-to-use-clj-time-to-get-current-time-by-localdatetime/11209/5 "2025-08-13T15:04:02Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
