public abstract class DateUtils extends Object
| Constructor and Description |
|---|
DateUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
format(DateFormatType dateFormat,
Date date)
时间格式化
|
static String |
format(String dateFormat,
Date date)
时间格式化
|
static Date |
getDate(Date time)
获取指定时间的日期
|
static Date |
getTomorrowDate(Date time)
获取指定时间的明天的日期
|
static Date |
parse(String str,
DateFormatType format)
解析常用时间
|
static Date |
parse(String str,
String format)
解析时间
|
static Date |
parseAll(String timeStr)
解析时间字符串
|
static Date |
parseDate(String str) |
static Date |
parseDate2(String str) |
static Date |
parseDate3(String str) |
static Date |
parseDateUnsigned(String str) |
static Date |
parseMillisecond(String str) |
static Date |
parseMillisecond2(String str) |
static Date |
parseMillisecondUnsigned(String str) |
static Date |
parseMinutes(String str) |
static Date |
parseMinutes2(String str) |
static Date |
parseMinutesUnsigned(String str) |
static Date |
parseMonth(String str) |
static Date |
parseMonth2(String str) |
static Date |
parseMonth3(String str) |
static Date |
parseMonthUnsigned(String str) |
static Date |
parseSeconds(String str) |
static Date |
parseSeconds2(String str) |
static Date |
parseSecondsUnsigned(String str) |
static String |
toDate(Date date)
格式化为:yyyy-MM-dd
|
static String |
toDate2(Date date)
格式化为:yyyy/MM/dd
|
static String |
toDate3(Date date)
格式化为:yyyy.MM.dd
|
static String |
toDateUnsigned(Date date)
格式化为:yyyyMMdd
|
static String |
toMilliseconds(Date date)
格式化为:yyyy-MM-dd HH:mm:ss.SSS
|
static String |
toMilliseconds2(Date date)
格式化为:yyyy/MM/dd HH:mm:ss.SSS
|
static String |
toMillisecondsUnsigned(Date date)
格式化为:yyyyMMddHHmmssSSS
|
static String |
toMinute(Date date)
格式化为:yyyy-MM-dd HH:mm
|
static String |
toMinute2(Date date)
格式化为:yyyy/MM/dd HH:mm
|
static String |
toMinuteUnsigned(Date date)
格式化为:yyyyMMddHHmm
|
static String |
toMonth(Date date)
格式化为:yyyy-MM
|
static String |
toMonth2(Date date)
格式化为:yyyy/MM
|
static String |
toMonth3(Date date)
格式化为:yyyy.MM
|
static String |
toMonthUnsigned(Date date)
格式化为:yyyyMM
|
static String |
toSeconds(Date date)
格式化为:yyyy-MM-dd HH:mm:ss
|
static String |
toSeconds2(Date date)
格式化为:yyyy/MM/dd HH:mm:ss
|
static String |
toSecondsUnsigned(Date date)
格式化为:yyyyMMddHHmmss
|
static String |
toString(Date date)
将时间对象转换为字符串
|
@NonNull public static Date getDate(Date time)
time - 时间@NonNull public static Date getTomorrowDate(@NonNull Date time)
time - 时间@NonNull public static Date parse(@NonNull String str, @NonNull DateFormatType format) throws ParseException
str - 时间字符串format - 常用时间格式ParseException - 解析异常@NonNull public static Date parse(@NonNull String str, @NonNull String format) throws ParseException
str - 时间字符串format - 格式化串ParseException - 解析异常@NonNull public static Date parseMonth(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseDate(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseMinutes(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseSeconds(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseMillisecond(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseMonth2(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseDate2(@NonNull String str) throws ParseException
ParseExceptionpublic static Date parseMinutes2(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseSeconds2(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseMillisecond2(String str) throws ParseException
ParseException@NonNull public static Date parseMonth3(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseDate3(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseMonthUnsigned(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseDateUnsigned(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseMinutesUnsigned(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseSecondsUnsigned(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseMillisecondUnsigned(@NonNull String str) throws ParseException
ParseException@NonNull public static Date parseAll(@NonNull String timeStr)
timeStr - 时间字符串public static String format(@NonNull String dateFormat, Date date)
dateFormat - 时间格式化date - 时间public static String format(@NonNull DateFormatType dateFormat, Date date)
dateFormat - 时间格式化date - 时间public static String toMinute(Date date)
date - 时间public static String toSeconds(Date date)
date - 时间public static String toMilliseconds(Date date)
date - 时间public static String toDate2(Date date)
date - 时间public static String toMinute2(Date date)
date - 时间public static String toSeconds2(Date date)
date - 时间public static String toMilliseconds2(Date date)
date - 时间public static String toDate3(Date date)
date - 时间public static String toMonthUnsigned(Date date)
date - 时间public static String toDateUnsigned(Date date)
date - 时间public static String toMinuteUnsigned(Date date)
date - 时间public static String toSecondsUnsigned(Date date)
date - 时间public static String toMillisecondsUnsigned(Date date)
date - 时间Copyright © 2021–2022 EasyJ开源社区. All rights reserved.