Android中对 Daylight savings time的处理是根据时区来处理的。
TimeZone zone = TimeZone.getTimeZone(tz); |
263 | boolean timeZoneWasChanged = false ; |
264 | synchronized ( this ) { |
265 | String current = SystemProperties.get(TIMEZONE_PROPERTY); |
266 | if (current == null || !current.equals(zone.getID())) { |
267 | if (localLOGV) Slog.v(TAG, "timezone changed: " + current + ", new=" + zone.getID()); |
268 | timeZoneWasChanged = true ; |
269 | SystemProperties.set(TIMEZONE_PROPERTY, zone.getID()); |
274 | int gmtOffset = zone.getRawOffset(); |
275 | if (zone.inDaylightTime( new Date(System.currentTimeMillis()))) { |
276 | gmtOffset += zone.getDSTSavings(); |
278 | setKernelTimezone(mDescriptor, -(gmtOffset / 60000 )); |
281 | TimeZone.setDefault( null ); |