Object Time
-
- All Implemented Interfaces:
public class Time时间相关常量和常用方法
<p>提供了日期格式化、获取当前时间、获取当前毫秒数和秒数、正则时间格式化等方法。</p> <p>注意:该类线程安全。</p>- Since:
2023-06-21
Toutatis_Gc
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringYMD_HORIZONTAL_FORMAT_REGEXpublic final static StringYMD_SLASH_FORMAT_REGEXpublic final static StringYMD_NON_SEPARATOR_FORMAT_REGEXpublic final static StringYMD_HMS_NON_SEPARATOR_TIME_REGEXpublic final static StringHMS_COLON_FORMAT_REGEXpublic final static StringSIMPLE_DATE_FORMAT_REGEXprivate final static StringcurrentTimeprivate final static LongcurrentMillisprivate final static LongcurrentSecondspublic final static TimeINSTANCE
-
Method Summary
Modifier and Type Method Description final static StringgetCurrentTimeByLong(Long time)final static StringgetCurrentLocalDateTime()final static StringregexTime(String format, Date date)final static StringregexTime(String format, Long time)final static StringregexTime(Date time)Regex time 使用默认格式化 final static LocalDateTimegetCurrentDayLastMillsTime()Get current day last mills time 获取这一天的最后一秒 即当天最后时间 final static DateparseData(String str)final static DateparseData(SimpleDateFormat simpleDateFormat, String str)final static LongparseTimeToMills(LocalDateTime time)final static BooleanisSameDay(String pattern, Long time)ISSUE 暂留 final static BooleanisBeforeNow(LocalDateTime time)Is before now 参数时间是否在当前时间之前 final static StringgetCurrentTime()final static LonggetCurrentMillis()final static LonggetCurrentSeconds()-
-
Method Detail
-
getCurrentTimeByLong
@Synchronized() final static String getCurrentTimeByLong(Long time)
- Parameters:
time- 传入值- Returns:
格式化值
-
getCurrentLocalDateTime
final static String getCurrentLocalDateTime()
-
regexTime
final static String regexTime(String format, Date date)
- Parameters:
format- 格式化正则date- 传入日期- Returns:
格式化时间
-
regexTime
final static String regexTime(String format, Long time)
- Parameters:
format- 格式化正则time- 传入日期- Returns:
格式化时间
-
regexTime
final static String regexTime(Date time)
Regex time 使用默认格式化
- Parameters:
time- 传入日期- Returns:
格式化时间
-
getCurrentDayLastMillsTime
final static LocalDateTime getCurrentDayLastMillsTime()
Get current day last mills time 获取这一天的最后一秒 即当天最后时间
- Returns:
当天最后时间最后一秒
-
parseData
final static Date parseData(SimpleDateFormat simpleDateFormat, String str)
-
parseTimeToMills
final static Long parseTimeToMills(LocalDateTime time)
-
isSameDay
final static Boolean isSameDay(String pattern, Long time)
ISSUE 暂留
- Parameters:
pattern- 格式化time- 日期- Returns:
忘了当时的调用逻辑了
-
isBeforeNow
final static Boolean isBeforeNow(LocalDateTime time)
Is before now 参数时间是否在当前时间之前
- Parameters:
time- 时间- Returns:
参数时间是否在当前时间之前
-
getCurrentTime
@Synchronized() final static String getCurrentTime()
-
getCurrentMillis
final static Long getCurrentMillis()
-
getCurrentSeconds
final static Long getCurrentSeconds()
-
-
-
-