我在我的scala代码中使用joda时间库.我的代码如下.
val dt:DateTime = new DateTime()
val dtf:DateTimeFormatter = DateTimeFormat.forPattern("yyyy-mm-dd")
return dtf.print(dt.minusDays(1))
Run Code Online (Sandbox Code Playgroud)
假设当前日期是2011年3月11日,上面的代码应该返回字符串2011-03-10,但我得到的输出是 2011-52-10
什么可能导致这个问题?
请帮助谢谢