MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / getDefault

Method getDefault

vm/JavaAPI/src/java/util/TimeZone.java:104–130  ·  view source on GitHub ↗

Gets the default TimeZone for this host. The source of the default TimeZone may vary with implementation.

()

Source from the content-addressed store, hash-verified

102 * Gets the default TimeZone for this host. The source of the default TimeZone may vary with implementation.
103 */
104 public static java.util.TimeZone getDefault(){
105 if (defaultTimeZone == null) {
106 final String tzone = getTimezoneId();
107 defaultTimeZone = new TimeZone() {
108 @Override
109 public int getOffset(int era, int year, int month, int day, int dayOfWeek, int timeOfDayMillis) {
110 return getTimezoneOffset(tzone, year, month + 1, day, timeOfDayMillis);
111 }
112
113 @Override
114 public int getRawOffset() {
115 return getTimezoneRawOffset(tzone);
116 }
117
118 boolean inDaylightTime(Date time) {
119 return isTimezoneDST(tzone, time.getTime());
120 }
121
122 @Override
123 public boolean useDaylightTime() {
124 return isTimezoneDST(tzone, getDec30()) != isTimezoneDST(tzone, getJuly1()); // 26 weeks
125 }
126 };
127 defaultTimeZone.ID = tzone;
128 }
129 return defaultTimeZone;
130 }
131
132 public static void setDefault(TimeZone timezone) {
133 defaultTimeZone = timezone;

Callers 15

formatMethod · 0.95
CalendarMethod · 0.95
setMonthMethod · 0.95
getXLabelsMethod · 0.95
DateUtilMethod · 0.95
runTestMethod · 0.95
mainMethod · 0.95
systemDefaultMethod · 0.95
formatPatternMethod · 0.95
parsePatternMethod · 0.95
formatPatternMethod · 0.95
parsePatternMethod · 0.95

Calls 1

getTimezoneIdMethod · 0.95