![](/img/trans.png)
[英]Get week start timestamp and week end timestamp using Java SE API and Joda Time (based on ISO)
[英]How to get the month start and end date for the ISO year using Joda time library in Java
对于特定的月份和年份,我想使用Java中的Joda时间库获取ISO年份的月份开始日期和结束日期。 举例来说,我的月份为2014年3月,所以我想知道ISO年3月的开始和结束日期。
除了joda-time库,是否还有其他方法可以获取相同的内容。
也许这可以帮助:
DateTime dt = new DateTime().withYear(2014).withMonthOfYear(3);
DateTime start = dt.withDayOfMonth(1).withTimeAtStartOfDay();
DateTime end = start.plusMonths(1).minusMillis(1);
LocalDate monthBegin = new LocalDate().withDayOfMonth(1);
LocalDate monthEnd = new LocalDate().plusMonths(1).withDayOfMonth(1).minusDays(1);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.