I took over a Clojure project and I am experiencing an error as follows:
No implementation of method: :to-date-time of protocol: #'clj-time.coerce/ICoerce found for class: java.time.LocalDateTime
Where I am trying to assign a value in here:
{ :start-date (time/to-string start-date) }
I am using clj-time as a dependency.
What I am confused about is especially the part where it says No implementation of method: :to-date-time of protocol even though I am using time/to-string
Is there a way I need to add that protocol?
Your help will be much more appreciated.
I resolved this issue. MYSQL 8 connector was returning Java LocalDateTime and clj-time was trying to convert this LocalDateTime into Joda Date time which does not exists in Java 8
I had to import those:
Create the formatter:
And then convert to string:
Special thanks to Steffan Westcott and Alan Thompson