public class DateTimeFunctions extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static java.time.ZoneOffset |
DEFAULT_ZONE_OFFSET |
static java.time.LocalDateTime |
UNIX_START_TIME |
static java.time.LocalDateTime |
ZERO_START_TIME |
| 构造器和说明 |
|---|
DateTimeFunctions() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Date |
addDate(Timestamp date,
Integer days) |
static Date |
addTime(Timestamp date,
String timeText) |
static String |
convertTZ(Timestamp date,
String originTZ,
String targetTZ) |
static Date |
date(Timestamp date) |
static String |
dateFormat(Timestamp date,
String mysqlPattern) |
static java.time.LocalDate |
fromDays(Integer days) |
static java.time.LocalDateTime |
fromUnixTime(Long unixTime) |
static java.time.LocalDate |
lastDay(Timestamp dateTime) |
static Date |
makeDate(Integer year,
Integer days) |
static String |
makeTime(Integer hours,
Integer minutes,
Integer seconds) |
static Long |
microSecond(Time time) |
static java.time.LocalDateTime |
now() |
static Integer |
periodAdd(Integer yearAndMonth,
Integer months) |
static Integer |
periodDiff(Integer yearAndMonth1,
Integer yearAndMonth2) |
static String |
secondsToTime(Integer totalSeconds) |
static Integer |
sleep(Integer seconds) |
static String |
strToDate(String dateStr,
String mysqlPattern) |
static Date |
subDate(Timestamp date,
Integer days) |
static Date |
subTime(Timestamp date,
String timeText) |
static Time |
time(Timestamp date) |
static String |
timeDiff(Timestamp date1,
Timestamp date2) |
static String |
timeFormat(Time time,
String mysqlPattern) |
static Long |
timeToSeconds(Time time) |
static Long |
toDays(Date date) |
static Long |
toSeconds(Timestamp date) |
static Long |
unixTimestamp()
function for UNIX_TIMESTAMP
|
static Long |
unixTimestamp(Timestamp timestamp)
function for UNIX_TIMESTAMP
|
static java.time.LocalDate |
utcDate() |
static java.time.LocalTime |
utcTime() |
static java.time.LocalDateTime |
utcTimestamp() |
static Integer |
weekDay(Timestamp timestamp) |
static Integer |
weekOfYear(Timestamp timestamp) |
static Integer |
yearWeek(Timestamp timestamp) |
static Integer |
yearWeek(Timestamp timestamp,
Integer mode) |
public static java.time.LocalDateTime ZERO_START_TIME
public static java.time.LocalDateTime UNIX_START_TIME
public static java.time.ZoneOffset DEFAULT_ZONE_OFFSET
public static Long unixTimestamp()
public static Long unixTimestamp(Timestamp timestamp) throws Exception
Exceptionpublic static java.time.LocalDateTime fromUnixTime(Long unixTime)
public static java.time.LocalDateTime utcTimestamp()
public static java.time.LocalDate utcDate()
public static java.time.LocalTime utcTime()
public static java.time.LocalDate fromDays(Integer days)
public static String dateFormat(Timestamp date, String mysqlPattern) throws Exception
Exceptionpublic static String timeFormat(Time time, String mysqlPattern) throws Exception
Exceptionpublic static java.time.LocalDate lastDay(Timestamp dateTime) throws Exception
Exceptionpublic static java.time.LocalDateTime now()
public static String strToDate(String dateStr, String mysqlPattern) throws Exception
Exceptionpublic static Integer yearWeek(Timestamp timestamp, Integer mode) throws Exception
Exceptionpublic static String convertTZ(Timestamp date, String originTZ, String targetTZ) throws Exception
Exceptionpublic static Integer periodAdd(Integer yearAndMonth, Integer months) throws Exception
ExceptionCopyright © 2021 kubeclub. All rights reserved.