简体   繁体   中英

Joda Time library in scala returning incorrect date

Im using the joda time library in my scala code. My code is as follows .

val dt:DateTime = new DateTime()
val dtf:DateTimeFormatter = DateTimeFormat.forPattern("yyyy-mm-dd")
return dtf.print(dt.minusDays(1))

Assuming the current date is March 11 2011,the above code should return the string 2011-03-10,but the output i get is 2011-52-10

What could be causing this problem ?

Please Help Thank You

DateTimeFormat ,模式mm为分钟,使用MM月。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM