public abstract class GaeaDateUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
timePattern |
| 构造器和说明 |
|---|
GaeaDateUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
checkTimeFormat(String time)
判断时间是否是2000-11-1 08:00:50
|
static String |
DateToString(Date time,
String pattern)
将date转字符串
|
static String |
formatFromSecond(long seconds)
秒转天、时、分、秒
|
static java.time.LocalDate |
fromString(String dateString,
String pattern)
把指定格式的字符串转换为LocalDate
|
static String |
javaTimeToSourceTime(Date date,
String pattern,
TimeZone timezone)
根据当前java机器时区转目标时区时间字符串
|
static String |
sourceTimeZoneToTargetTimeZone(String sourceTime)
将浏览器时区转java时区,默认取上下文时区
|
static Date |
sourceTimeZoneToTargetTimeZone(String sourceTime,
String format,
TimeZone sourceTimeZone,
TimeZone targetTimeZone)
原时区转目标时区
|
static Date |
StringToDate(String time,
String pattern)
将字符串转date
|
static Date |
timeMillisToDate(String timeMillis)
将时间戳转Date
|
static Date |
toDate(java.time.LocalDate localDate)
LocalDate 转换为Date
|
static Date |
toDate(java.time.LocalDateTime localDateTime)
localDateTime 转换为Date
|
static java.time.LocalDate |
toLocalDate(Date date)
date 转换为LocalDate
|
static java.time.LocalDateTime |
toLocalDateTime(Date date)
date 转换为LocalDateTime
|
static String |
toString(Date date,
String pattern)
日期转换为指定格式的字符串
|
static String |
toString(java.time.LocalDate localDate,
String pattern)
日期转换为指定格式的字符串
|
public static String toString(Date date, String pattern)
date - pattern - public static String toString(java.time.LocalDate localDate, String pattern)
localDate - pattern - public static java.time.LocalDate fromString(String dateString, String pattern)
dateString - pattern - public static Date toDate(java.time.LocalDate localDate)
localDate - public static Date toDate(java.time.LocalDateTime localDateTime)
localDateTime - public static java.time.LocalDate toLocalDate(Date date)
date - public static java.time.LocalDateTime toLocalDateTime(Date date)
date - public static String formatFromSecond(long seconds)
seconds - public static Date sourceTimeZoneToTargetTimeZone(String sourceTime, String format, TimeZone sourceTimeZone, TimeZone targetTimeZone)
sourceTime - format - sourceTimeZone - targetTimeZone - public static String sourceTimeZoneToTargetTimeZone(String sourceTime)
sourceTime - public static String javaTimeToSourceTime(Date date, String pattern, TimeZone timezone)
date - pattern - timezone - public static Date StringToDate(String time, String pattern)
time - pattern - public static String DateToString(Date time, String pattern)
time - pattern - public static Date timeMillisToDate(String timeMillis)
timeMillis - public static boolean checkTimeFormat(String time)
time - Copyright © 2022 Anji-Plus. All rights reserved.