Joda Time从Year + WeekOfYear + DayOfWeek获取日期

时间:2015-12-18 16:12:37

标签: java date jodatime

Java lib JODA Time是否可以从

创建日期
  • 年度周(1至52或53,视情况而定)
  • 星期几(1到7)?

Java有一个可以计算它的日历函数(http://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html#setWeekDate%28int,%20int,%20int%29

1 个答案:

答案 0 :(得分:3)

 DateTime dt = new DateTime();
 dt = dt.withYear(2015);
 dt = dt.withWeekOfWeekyear(10);
 dt = dt.withDayOfWeek(3);