斯达拉乔达时间库返回不正确的日期
问题描述:
在我的斯卡拉代码中使用乔达时间库。我的代码如下。斯达拉乔达时间库返回不正确的日期
val dt:DateTime = new DateTime()
val dtf:DateTimeFormatter = DateTimeFormat.forPattern("yyyy-mm-dd")
return dtf.print(dt.minusDays(1))
假设当前日期是2011年3月11日,上面的代码应该返回字符串2011-03-10,但输出我得到的是2011-52-10
什么导致这个问题呢?
请帮助 谢谢