Jodatime 一天的开始和结束
我想在本周开始和当前一周结束之间创建一个间隔。
我有以下代码,借用了这个答案:
private LocalDateTime calcNextSunday(LocalDateTime d) {
if (d.getDayOfWeek() > DateTimeConstants.SUNDAY) {
d = d.plusWeeks(1);
}
return d.withDayOfWeek(DateTimeConstants.SUNDAY);
}
private LocalDateTime calcPreviousMonday(LocalDateTime d) {
if (d.getDayOfWeek() < DateTimeConstants.MONDAY) {
d = d.minusWeeks(1);
}
return d.withDayOfWeek(DateTimeConstants.MONDAY);
}
但现在我希望星期一在00:00:00,星期天在23:59:59。我该怎么做?LocalDateTime
LocalDateTime