public class DateDemo {
public static void main(String[] args) {
LocalDate today = LocalDate.now();
int day= today.get(ChronoField.DAY_OF_YEAR);
System.out.println("今天是本年的第"+day+"天");
day= today.get(ChronoField.DAY_OF_MONTH);
System.out.println("今天是本月的第"+day+"天");
day=today.get(ChronoField.DAY_OF_WEEK);
System.out.println("今天是本周的第"+day+"天");
}
}
java8 求年、月、周的第几天
最新推荐文章于 2023-04-17 18:45:27 发布