Test.java
643 Bytes
package com.viontech.keliu;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
/**
* Created with IntelliJ IDEA.
*
* @author: zhuhai
* Date: 2023-03-28
* Time: 10:57
*/
public class Test {
public static void main(String[] args) {
DateTime dateTime = DateUtil.beginOfHour(new Date());
System.out.println(dateTime);
System.out.println(DateUtil.hour(new Date(), true));
System.out.println(DateUtil.dayOfMonth(new Date()));
System.out.println(DateUtil.dayOfWeek(new Date()));
System.out.println(DateUtil.dayOfYear(new Date()));
}
}