public final class FixedDateTimeZone extends DateTimeZone
FixedDateTimeZone is thread-safe and immutable.
UTC| 构造器和说明 |
|---|
FixedDateTimeZone(String id,
String nameKey,
int wallOffset,
int standardOffset) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(Object obj)
Compare this datetime zone with another.
|
String |
getNameKey(long instant)
Returns a non-localized name that is unique to this time zone.
|
int |
getOffset(long instant)
Gets the millisecond offset to add to UTC to get local time.
|
int |
getOffsetFromLocal(long instantLocal)
Gets the millisecond offset to subtract from local time to get UTC time.
|
int |
getStandardOffset(long instant)
Gets the standard millisecond offset to add to UTC to get local time,
when standard time is in effect.
|
int |
hashCode()
Gets a hash code compatable with equals.
|
boolean |
isFixed()
Returns true if this time zone has no transitions.
|
long |
nextTransition(long instant)
Advances the given instant to where the time zone offset or name changes.
|
long |
previousTransition(long instant)
Retreats the given instant to where the time zone offset or name changes.
|
TimeZone |
toTimeZone()
Override to return the correct timzone instance.
|
adjustOffset, convertLocalToUTC, convertLocalToUTC, convertUTCToLocal, forID, forOffsetHours, forOffsetHoursMinutes, forOffsetMillis, forTimeZone, getAvailableIDs, getDefault, getID, getMillisKeepLocal, getName, getName, getNameProvider, getOffset, getProvider, getShortName, getShortName, isLocalDateTimeGap, isStandardOffset, setDefault, setNameProvider, setProvider, toString, writeReplacepublic String getNameKey(long instant)
DateTimeZonegetNameKey 在类中 DateTimeZoneinstant - milliseconds from 1970-01-01T00:00:00Z to get the name forpublic int getOffset(long instant)
DateTimeZonegetOffset 在类中 DateTimeZoneinstant - milliseconds from 1970-01-01T00:00:00Z to get the offset forpublic int getStandardOffset(long instant)
DateTimeZonegetStandardOffset 在类中 DateTimeZoneinstant - milliseconds from 1970-01-01T00:00:00Z to get the offset forpublic int getOffsetFromLocal(long instantLocal)
DateTimeZone
millisLocal == millisUTC + getOffset(millisUTC) millisUTC == millisLocal - getOffsetFromLocal(millisLocal)
NOTE: After calculating millisLocal, some error may be introduced. At offset transitions (due to DST or other historical changes), ranges of local times may map to different UTC times.
This method will return an offset suitable for calculating an instant
after any DST gap. For example, consider a zone with a cutover
from 01:00 to 01:59:
Input: 00:00 Output: 00:00
Input: 00:30 Output: 00:30
Input: 01:00 Output: 02:00
Input: 01:30 Output: 02:30
Input: 02:00 Output: 02:00
Input: 02:30 Output: 02:30
During a DST overlap (where the local time is ambiguous) this method will return the earlier instant. The combination of these two rules is to always favour daylight (summer) time over standard (winter) time.
NOTE: Prior to v2.0, the DST overlap behaviour was not defined and varied by hemisphere. Prior to v1.5, the DST gap behaviour was also not defined.
getOffsetFromLocal 在类中 DateTimeZoneinstantLocal - the millisecond instant, relative to this time zone, to get the offset forpublic boolean isFixed()
DateTimeZoneisFixed 在类中 DateTimeZonepublic long nextTransition(long instant)
DateTimeZonenextTransition 在类中 DateTimeZoneinstant - milliseconds from 1970-01-01T00:00:00Zpublic long previousTransition(long instant)
DateTimeZonepreviousTransition 在类中 DateTimeZoneinstant - milliseconds from 1970-01-01T00:00:00Zpublic TimeZone toTimeZone()
toTimeZone 在类中 DateTimeZonepublic boolean equals(Object obj)
DateTimeZoneequals 在类中 DateTimeZoneobj - the object to compare withpublic int hashCode()
DateTimeZonehashCode 在类中 DateTimeZoneCopyright © 2019. All rights reserved.