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 intstatic booleanstatic StringformatDate(String fromPattern, String dateString, Locale locale) static StringgetCurrentDate(String pattern, Locale locale) static StringgetCurrentDate(String pattern, Locale locale, TimeZone timeZone) static Stringstatic Stringstatic intgetDaysBetween(Date date1, Date date2) static intgetDaysBetween(Date date1, Date date2, TimeZone timeZone) static DateFormatstatic DateFormatstatic DateFormatgetISOFormat(String text) static DateFormatstatic DateFormatgetUTCFormat(String text) static intstatic booleanisFormatAmPm(Locale locale) static DatenewDate()static DatenewDate(long date) static longnewTime()static Datestatic 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
-