我之前从未使用过JodaTime,但回答了这个问题,如何在一个月内获得序数平日.
我尝试了它并想出了这个丑陋的代码来取消下面的所有字段:
DateTime startOfMonth =
input.withDayOfMonth(1)
.withHourOfDay(0) // there
.withMinuteOfHour(0) // has got to
.withSecondOfMinute(0) // be a shorter way
.withMillisOfSecond(0); // to do this
Run Code Online (Sandbox Code Playgroud)
Date startOfMonth = DateUtils.truncate(input, Calendar.MONTH);
Run Code Online (Sandbox Code Playgroud)
在JodaTime中,首选的成语是什么?