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 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
getDefaultDateFormat()
static DateFormat
getDefaultDateFormat(Locale locale)
static Locale
getLocaleFromString(String locale)
static Locale
getLocaleFromString(String locale, Locale defaultValue)
ParseLocale
from 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)
ParseLocale
from 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)
-
-