java.util.Locale#setDefault(Locale) and
java.util.TimeZone#setDefault(TimeZone) methods, because
the locale/time zone specific handling of certain office documents -
maybe for different time zones / locales ... - shouldn't affect
other java components.
The settings are saved in a java.lang.ThreadLocal ,
so they only apply to the current thread and can't be set globally.
| Modifier and Type | Field and Description |
|---|---|
| public static final Charset | CHARSET_1252
Default encoding for unknown byte encodings of native files (at least it's better than to rely on a platform dependent encoding for legacy stuff ...) |
| public static final TimeZone | TIMEZONE_UTC
Excel doesn't store TimeZone information in the file, so if in doubt, use UTC to perform calculations |
| private static final ThreadLocal | |
| private static final ThreadLocal |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static int | Returns: the default code pagethe LCID value lcid)Get default code page from LCID value |
| public static Calendar | |
| public static Calendar | Returns: a calendar for the user locale and time zone, and the given dateConvenience method - month is 0-based as in java.util.Calendar |
| public static Calendar | Returns: a calendar for the user locale and time zone, and the given dateConvenience method - month is 0-based as in java.util.Calendar |
| public static Calendar | |
| public static String | Returns: the locale/language IDthe LCID value lcid)Decode the language ID from LCID value |
| public static Locale | |
| public static TimeZone | Returns: the time zone which is used for date calculations. If not set, returnsTimeZone#getDefault().
|
| public static void | |
| public static void | |
| public static void | |
| public static void | setUserTimeZone(TimeZone
the timezone under which date calculations take place timezone)As time zone information is not stored in any format, it can be set before any date calculations take place. |
| CHARSET_1252 | back to summary |
|---|---|
| public static final Charset CHARSET_1252 Default encoding for unknown byte encodings of native files (at least it's better than to rely on a platform dependent encoding for legacy stuff ...) | |
| TIMEZONE_UTC | back to summary |
|---|---|
| public static final TimeZone TIMEZONE_UTC Excel doesn't store TimeZone information in the file, so if in doubt, use UTC to perform calculations | |
| userLocale | back to summary |
|---|---|
| private static final ThreadLocal<Locale> userLocale | |
| userTimeZone | back to summary |
|---|---|
| private static final ThreadLocal<TimeZone> userTimeZone | |
| LocaleUtil | back to summary |
|---|---|
| private LocaleUtil() | |
| getDefaultCodePageFromLCID | back to summary |
|---|---|
| public static int getDefaultCodePageFromLCID(int lcid) Get default code page from LCID value
| |
| getLocaleCalendar | back to summary |
|---|---|
public static Calendar getLocaleCalendar()
| |
| getLocaleCalendar | back to summary |
|---|---|
| public static Calendar getLocaleCalendar(int year, int month, int day) Convenience method - month is 0-based as in java.util.Calendar
| |
| getLocaleCalendar | back to summary |
|---|---|
| public static Calendar getLocaleCalendar(int year, int month, int day, int hour, int minute, int second) Convenience method - month is 0-based as in java.util.Calendar
| |
| getLocaleCalendar | back to summary |
|---|---|
public static Calendar getLocaleCalendar(TimeZone timeZone)
| |
| getLocaleFromLCID | back to summary |
|---|---|
| public static String getLocaleFromLCID(int lcid) Decode the language ID from LCID value
| |
| getUserLocale | back to summary |
|---|---|
public static Locale getUserLocale()
| |
| getUserTimeZone | back to summary |
|---|---|
public static TimeZone getUserTimeZone()
| |
| resetUserLocale | back to summary |
|---|---|
| public static void resetUserLocale() | |
| resetUserTimeZone | back to summary |
|---|---|
| public static void resetUserTimeZone() Clear the thread-local user time zone. | |
| setUserLocale | back to summary |
|---|---|
| public static void setUserLocale(Locale locale) Sets default user locale. This setting is specific to the current thread. | |
| setUserTimeZone | back to summary |
|---|---|
| public static void setUserTimeZone(TimeZone timezone) As time zone information is not stored in any format, it can be set before any date calculations take place. This setting is specific to the current thread.
| |