DateTime time=DateTimeFormat.forPattern(\"yyyy-ww\").parseDateTime(\"2013-01\");
where DateTimeFormat
is org.joda.time.format.DateT
See here.
The w
, week of weekyear, pattern letter is meant to be used with x
, weekyear. From the javadoc of DateTimeFormat
x weekyear year 1996
w week of weekyear number 27
Change your pattern to
DateTimeFormat.forPattern("xxxx-ww")
and you'll parse to
2012-12-31T00:00:00.000-08:00
Depending on your Locale
, the first week of 2013 started in 2012.