类型值plusHours不是org.joda.time.DateTime的成员

编程入门 行业动态 更新时间:2024-10-28 13:15:57
本文介绍了类型值plusHours不是org.joda.time.DateTime的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Scala和Joda时间,但是我不能使用大多数方法.

I'm using Scala and Joda time, but I can't use most methods.

例如,这很好用

var now = DateTime.now()

但这不是

var now = DateTime.now() var then = now.plusHours(2)

类型值plusHours不是org.joda.time.DateTime的成员

如果我建造,我还会收到以下错误:

If i build i receive also these errors:

加载DateTime时出错,缺少依赖项'org.joda.convert.FromString类',C:\ Documents and Settings \ Vallo \ Mis documentos \ Downloads \ joda-time-2.2.jar(org/joda/time /DateTime.class)TP4未知Scala问题

error while loading DateTime, Missing dependency 'class org.joda.convert.FromString', required by C:\Documents and Settings\Vallo\Mis documentos\Downloads\joda-time-2.2.jar(org/joda/time/DateTime.class) TP4 Unknown Scala Problem

加载DateTimeZone时出错,缺少依赖项'org.joda.convert.FromString类',C:\ Documents and Settings \ Vallo \ Mis documentos \ Downloads \ joda-time-2.2.jar(org/joda/time /DateTimeZone.class)TP4未知Scala问题

error while loading DateTimeZone, Missing dependency 'class org.joda.convert.FromString', required by C:\Documents and Settings\Vallo\Mis documentos\Downloads\joda-time-2.2.jar(org/joda/time/DateTimeZone.class) TP4 Unknown Scala Problem

错误,缺少依赖项类org.joda.convert.ToString",C:\ Documents and Settings \ Vallo \ Mis documentos \ Downloads \ joda-time-2.2.jar(org/joda/time /base/AbstractInstant.class)TP4未知Scala问题

error while loading AbstractInstant, Missing dependency 'class org.joda.convert.ToString', required by C:\Documents and Settings\Vallo\Mis documentos\Downloads\joda-time-2.2.jar(org/joda/time/base/AbstractInstant.class) TP4 Unknown Scala Problem

(文件C:\ Documents and Settings \ Vallo \ Mis documentos \ Downloads \ joda-time-2.2.jar存在)

(the file C:\Documents and Settings\Vallo\Mis documentos\Downloads\joda-time-2.2.jar exists)

但是,诸如DateTime.isBefore或.isAfter之类的方法可以正常工作.我感觉到静态方法是唯一对我有用的方法,但是我不确定.

However, methods like DateTime.isBefore or .isAfter works fine. I've got the feeling that static methods are the only one that work for me, but I'm not sure.

有任何线索吗?非常感谢.

Any clues? Thanks a lot.

推荐答案

似乎您可能需要添加 joda-convert 也作为依赖项.

It seems that you might need to add joda-convert as a dependency too.

更多推荐

类型值plusHours不是org.joda.time.DateTime的成员

本文发布于:2023-11-25 13:35:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629963.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:成员   类型   plusHours   joda   org

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!