add method

This commit is contained in:
Looly 2022-06-05 23:35:35 +08:00
parent b9738afef9
commit 6fcb3cd666
2 changed files with 11 additions and 1 deletions

View File

@ -96,6 +96,16 @@ public class DateUtil extends CalendarUtil {
return new DateTime(date);
}
/**
* 根据已有{@link Date} 产生新的{@link DateTime}对象并根据指定时区转换
*
* @param date Date对象
* @return {@link DateTime}对象
*/
public static DateTime date(final Date date, final TimeZone timeZone) {
return new DateTime(date, timeZone);
}
/**
* Long类型时间转为{@link DateTime}<br>
* 只支持毫秒级别时间戳如果需要秒级别时间戳请自行×1000

View File

@ -30,7 +30,7 @@ import java.util.TimeZone;
* JDK8+中的{@link LocalDateTime} 工具类封装
*
* @author looly
* @see DateUtil java7和一下版本使用Date工具类
* @see DateUtil java7及其以下版本使用Date工具类
* @see DatePattern 常用格式工具类
* @since 5.3.9
*/