Package com.liferay.portal.kernel.util
Class DateUtil
Object
com.liferay.portal.kernel.util.DateUtil
- Author:
- Brian Wing Shun Chan
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
static boolean
static String
formatDate
(String fromPattern, String dateString, Locale locale) static String
getCurrentDate
(String pattern, Locale locale) static String
getCurrentDate
(String pattern, Locale locale, TimeZone timeZone) static String
static String
static int
getDaysBetween
(Date date1, Date date2) static int
getDaysBetween
(Date date1, Date date2, TimeZone timeZone) static DateFormat
static DateFormat
static DateFormat
getISOFormat
(String text) static DateFormat
static DateFormat
getUTCFormat
(String text) static int
static boolean
isFormatAmPm
(Locale locale) static Date
newDate()
static Date
newDate
(long date) static long
newTime()
static Date
static Date
-
Field Details
-
ISO_8601_PATTERN
- See Also:
-
-
Constructor Details
-
DateUtil
public DateUtil()
-
-
Method Details
-
compareTo
-
equals
-
formatDate
public static String formatDate(String fromPattern, String dateString, Locale locale) throws ParseException - Throws:
ParseException
-
getCurrentDate
-
getCurrentDate
-
getDate
-
getDate
-
getDaysBetween
-
getDaysBetween
-
getISO8601Format
-
getISOFormat
-
getISOFormat
-
getUTCFormat
-
getUTCFormat
-
getYear
-
isFormatAmPm
-
newDate
-
newDate
-
newTime
public static long newTime() -
parseDate
- Throws:
ParseException
-
parseDate
public static Date parseDate(String pattern, String dateString, Locale locale) throws ParseException - Throws:
ParseException
-