开始日期后的一个月-乔达 [英] one month after start date-joda
本文介绍了开始日期后的一个月-乔达的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须调用一个需要两个参数开始日期和结束日期的方法,而我的结束日期恰好在开始日期之后一个月.我用了这个:
I have to call a method that needs two parameters begin date and end date and my end date is exactly one month after the begin date. I used this:
mymethod(startDate.toDate(), startDate.plusMonths(1));
但是我得到了这个错误:
but I got this error:
the method mymethod(Date, Date) is not applicable for the arguments (Date, DateTime)
任何想法我该如何解决?
Any idea how can I fix it?
推荐答案
mymethod(startDate.toDate(), startDate.plusMonths(1));
应该是:
mymethod(startDate.toDate(), startDate.plusMonths(1).toDate());
这篇关于开始日期后的一个月-乔达的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文