Package org.keycloak.theme
Class DateTimeFormatterUtil
- java.lang.Object
-
- org.keycloak.theme.DateTimeFormatterUtil
-
public class DateTimeFormatterUtil extends Object
Util class for localized date and time representation- Author:
- Martin Bartos
-
-
Constructor Summary
Constructors Constructor Description DateTimeFormatterUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetDateTimeFromMillis(long millis)static StringgetDateTimeFromMillis(long millis, String locale)static StringgetDateTimeFromMillis(long millis, DateFormat dateFormat)Get string representation of localized date and timestatic StringgetDateTimeFromMillis(long millis, Locale locale)static DateFormatgetDefaultDateFormat()static DateFormatgetDefaultDateFormat(Locale locale)static LocalegetLocaleFromString(String locale)static LocalegetLocaleFromString(String locale, Locale defaultValue)ParseLocalefrom string
-
-
-
Method Detail
-
getDateTimeFromMillis
public static String getDateTimeFromMillis(long millis)
-
getDateTimeFromMillis
public static String getDateTimeFromMillis(long millis, DateFormat dateFormat)
Get string representation of localized date and time- Parameters:
millis- number of milliseconds passed since January 1, 1970, 00:00:00 GMTdateFormat- format of date and time. SeeDateFormat- Returns:
- string representation
-
getLocaleFromString
public static Locale getLocaleFromString(String locale, Locale defaultValue)
ParseLocalefrom string- Parameters:
locale- required localedefaultValue- default value if the locale parameter is invalid- Returns:
- Locale
-
getDefaultDateFormat
public static DateFormat getDefaultDateFormat()
-
getDefaultDateFormat
public static DateFormat getDefaultDateFormat(Locale locale)
-
-