Package org.keycloak.theme
Class DateTimeFormatterUtil
java.lang.Object
org.keycloak.theme.DateTimeFormatterUtil
Util class for localized date and time representation
- Author:
- Martin Bartos
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 DateFormatstatic DateFormatgetDefaultDateFormat(Locale locale) static LocalegetLocaleFromString(String locale) static LocalegetLocaleFromString(String locale, Locale defaultValue) ParseLocalefrom string
-
Constructor Details
-
DateTimeFormatterUtil
public DateTimeFormatterUtil()
-
-
Method Details
-
getDateTimeFromMillis
-
getDateTimeFromMillis
-
getDateTimeFromMillis
-
getDateTimeFromMillis
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
-
getLocaleFromString
ParseLocalefrom string- Parameters:
locale- required localedefaultValue- default value if the locale parameter is invalid- Returns:
- Locale
-
getDefaultDateFormat
-
getDefaultDateFormat
-