public class DateTimeUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
AFTER_TOMORROW |
static String |
BEFORE_YESTERDAY |
static DateFormat |
dateFormat |
static DateFormat |
dateTimeFormat |
static String |
FRIDAY |
static String |
MONDAY |
static String |
SATURDAY |
static String |
SUNDAY |
static String |
THURSDAY |
static String |
TODAY |
static String |
TOMORROW |
static String |
TUESDAY |
static String |
WEDNESDAY |
static String |
YESTERDAY |
| 构造器和说明 |
|---|
DateTimeUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
calMonthDays(int year,
int month,
int day)
计算指定月份最大天数
|
static boolean |
compareDate(String a,
String b)
A大于B
|
static String |
getDateDetail(String date)
将日期信息转换成今天、明天、后天、星期
|
static long |
getDateTimeCount(Date startDate,
Date endDate)
获取两个日期之间的间隔时间
|
static String |
getDateTimeCountStr(Date startDate,
Date endDate)
获取两个日期之间的间隔时间文本
|
static int |
getDayOfWeek(String source)
将日期信息转换成星期
|
static String |
getWeekDay(Date date)
将日期信息转换成星期
|
static boolean |
isSame(String a,
String b)
相同
|
static String |
parseDateStr(String str)
输出自定义日期
|
public static DateFormat dateFormat
public static DateFormat dateTimeFormat
public static int getDayOfWeek(String source)
source - public static String getDateTimeCountStr(Date startDate, Date endDate)
public static int calMonthDays(int year,
int month,
int day)
year - month - day - Copyright © 2020. All rights reserved.