mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add method
This commit is contained in:
parent
b9738afef9
commit
6fcb3cd666
@ -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
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user