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 SummaryConstructors Constructor Description DateTimeFormatterUtil()
 - 
Method SummaryAll 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- 
getDateTimeFromMillispublic static String getDateTimeFromMillis(long millis) 
 - 
getDateTimeFromMillispublic 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 GMT
- dateFormat- format of date and time. See- DateFormat
- Returns:
- string representation
 
 - 
getLocaleFromStringpublic static Locale getLocaleFromString(String locale, Locale defaultValue) ParseLocalefrom string- Parameters:
- locale- required locale
- defaultValue- default value if the locale parameter is invalid
- Returns:
- Locale
 
 - 
getDefaultDateFormatpublic static DateFormat getDefaultDateFormat() 
 - 
getDefaultDateFormatpublic static DateFormat getDefaultDateFormat(Locale locale) 
 
- 
 
-