ICOCERCE会产生迄今为止的协议错误
我接手了一个 Clojure 项目,遇到了如下错误:
No implementation of method: :to-date-time of protocol: #'clj-time.coerce/ICoerce found for class: java.time.LocalDateTime
我试图在这里分配一个值:
{ :start-date (time/to-string start-date) }
我正在使用 clj-time 作为依赖项。
我感到困惑的尤其是它说的部分 没有实现方法: :to-date-time of protocol 即使我使用 time/to-string
是我需要添加该协议吗?
我们将更加感谢您的帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了这个问题。 MYSQL 8 连接器返回 Java LocalDateTime 并且 clj-time 试图将此 LocalDateTime 转换为 Java 8 中不存在的 Joda 日期时间
我必须导入这些:
创建格式化程序:
然后转换为字符串:
特别感谢 Steffan Westcott 和艾伦·汤普森
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