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
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getDateTimeFromMillis
(long millis) static String
getDateTimeFromMillis
(long millis, String locale) static String
getDateTimeFromMillis
(long millis, DateFormat dateFormat) Get string representation of localized date and timestatic String
getDateTimeFromMillis
(long millis, Locale locale) static DateFormat
static DateFormat
getDefaultDateFormat
(Locale locale) static Locale
getLocaleFromString
(String locale) static Locale
getLocaleFromString
(String locale, Locale defaultValue) ParseLocale
from 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
ParseLocale
from string- Parameters:
locale
- required localedefaultValue
- default value if the locale parameter is invalid- Returns:
- Locale
-
getDefaultDateFormat
-
getDefaultDateFormat
-