public class DateUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DateUtil.TIMETYPE
The Enum TIMETYPE.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DATE_TIME_FORMAT |
static String |
DATE_TIME_FORMAT_2 |
static org.apache.log4j.Logger |
logger |
| Constructor and Description |
|---|
DateUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
dateToDateFormatString(Date date)
Date to date format string.
|
static Date |
getDate(Calendar calendar)
Gets the date.
|
static Date |
getDateFormat(Calendar calendar)
Gets the date format.
|
static String |
getDifference(long date1,
long date2)
Gets the difference.
|
static long |
getDifference(long date1,
long date2,
DateUtil.TIMETYPE timeType)
Gets the difference.
|
static Date |
millisecondsToDate(long milliseconds)
Milliseconds to date.
|
static Date |
stringToDateFormat(String date)
String to date format.
|
static Date |
toDate(Calendar calendar)
To date.
|
static Date |
toDateFormat(Calendar calendar)
To date format.
|
static String |
toDateFormatToString(Calendar calendar)
To date format to string.
|
public static org.apache.log4j.Logger logger
public static final String DATE_TIME_FORMAT
public static final String DATE_TIME_FORMAT_2
public static Date toDate(Calendar calendar)
calendar - the calendarpublic static String toDateFormatToString(Calendar calendar)
calendar - the calendarpublic static Date toDateFormat(Calendar calendar)
calendar - the calendarpublic static Date getDateFormat(Calendar calendar)
calendar - the calendarpublic static Date getDate(Calendar calendar)
calendar - the calendarpublic static Date stringToDateFormat(String date)
date - the datepublic static String dateToDateFormatString(Date date)
date - the datepublic static Date millisecondsToDate(long milliseconds)
milliseconds - the millisecondspublic static long getDifference(long date1,
long date2,
DateUtil.TIMETYPE timeType)
date1 - the date1date2 - the date2timeType - the time typepublic static String getDifference(long date1, long date2)
date1 - the date1date2 - the date2Copyright © 2020. All Rights Reserved.