- Enclosing class:
DateKit
public static class DateKit.SQL
extends Object
java.sql.*日期时间相关封装
考虑到JDK9+模块化后,java.sql并非默认引入模块,因此将相关内容单独封装为工具,避免类找不到问题。
-
Constructor Summary
Constructors
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Details
-
timestamp
- Parameters:
date - 日期时间,非空
- Returns:
Timestamp
-
date
- Parameters:
date - 日期时间,非空
- Returns:
Date
-
time
- Parameters:
date - 日期时间,非空
- Returns:
Time
-
wrap
public static <T extends Date> T wrap(Class<?> targetClass,
long mills)
- Type Parameters:
T - 日期类型
- Parameters:
targetClass - 目标类型
mills - Date
- Returns:
- 目标类型对象