C# Class Kimono.KTimeZone

Inheritance: Object, IDisposable
ファイルを表示 Open project: 0xd34df00d/Qross Class Usage Examples

Protected Properties

Property Type Description
interceptor SmokeInvocation

Public Methods

Method Description
Abbreviation ( Qyoto.QDateTime utcDateTime ) : Qyoto.QByteArray Returns the time zone abbreviation current at a specified time. name="utcDateTime" UTC date/time. An error occurs if utcDateTime.timeSpec() is not Qt.UTC.
Abbreviations ( ) : List Returns the list of time zone abbreviations used by the time zone. This may include historical ones which are no longer in use or have been superseded.
Comment ( ) : string Returns any comment for the time zone.
Convert ( KTimeZone newZone, Qyoto.QDateTime zoneDateTime ) : Qyoto.QDateTime Converts a date/time, which is interpreted as being local time in this time zone, into local time in another time zone. name="newZone" other time zone which the time is to be converted into name="zoneDateTime" local date/time. An error occurs if zoneDateTime.timeSpec() is not Qt.LocalTime.
CountryCode ( ) : string Returns the two-letter country code of the time zone.
CurrentOffset ( ) : int
CurrentOffset ( Qt basis ) : int Returns the current offset of this time zone to UTC or the local system time zone. The offset is the number of seconds which you must add to UTC or the local system time to get local time in this time zone. Take care if you cache the results of this routine; that would break if the result were stored across a daylight savings change. name="basis" Qt.UTC to return the offset to UTC, Qt.LocalTime to return the offset to local system time
Data ( ) : KTimeZoneData
Data ( bool create ) : KTimeZoneData Returns the detailed parsed data for the time zone. This will return null unless either parse() has been called beforehand, or create is true. name="create" true to parse the zone's data first if not already parsed
Dispose ( ) : void
Equals ( object o ) : bool Checks whether this is the same instance as another one. Note that only the pointers to the time zone data are compared, not the contents. So it will only return equality if one instance was copied from the other. name="rhs" other instance
FromTime_t ( int t ) : QDateTime Converts a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2)), to a UTC QDateTime value. QDateTime.SetTime_t() is limited to handling t >= 0, since its parameter is unsigned. This method takes a parameter of time_t which is signed.
GetHashCode ( ) : int
InvalidOffset ( ) : int
InvalidTime_t ( ) : int
IsValid ( ) : bool Checks whether the instance is valid.
KTimeZone ( KTimeZone tz ) : System
KTimeZone ( KTimeZoneBackend impl ) : System
KTimeZone ( string name ) : System Constructs a UTC time zone. name="name" name of the UTC time zone
Latitude ( ) : float Returns the latitude of the time zone.
LeapSecondChanges ( ) : List Return all leap second adjustments, in time order. Note that some time zone data sources (such as system time zones accessed via the system libraries) may not provide information on leap second adjustments. In such cases, this method will return an empty list.
Longitude ( ) : float Returns the latitude of the time zone.
Name ( ) : string Returns the name of the time zone. If it is held in a KTimeZones container, the name is the time zone's unique identifier within that KTimeZones instance.
Parse ( ) : bool Extracts time zone detail information for this time zone from the source database.
Phases ( ) : List Return all daylight savings time phases for the time zone. Note that some time zone data sources (such as system time zones accessed via the system libraries) may not allow a list of daylight savings time changes to be compiled easily. In such cases, this method will return an empty list.
Source ( ) : KTimeZoneSource Returns the source reader/parser for the time zone's source database.
ToTime_t ( QDateTime utcDateTime ) : int Converts a UTC QDateTime to a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2)). QDateTime.ToTime_t() returns an unsigned value. This method returns a time_t value, which is signed. name="utcDateTime" date/time. An error occurs if utcDateTime.timeSpec() is not Qt.UTC.
ToUtc ( QDateTime zoneDateTime ) : QDateTime Converts a date/time, which is interpreted as local time in this time zone, into UTC. Because of daylight savings time shifts, the date/time may occur twice. In such cases, this method returns the UTC time for the first occurrence. If you need the UTC time of the second occurrence, use offsetAtZoneTime(). name="zoneDateTime" local date/time. An error occurs if zoneDateTime.timeSpec() is not Qt.LocalTime.
ToZoneTime ( QDateTime utcDateTime ) : QDateTime
ToZoneTime ( QDateTime utcDateTime, bool &secondOccurrence ) : QDateTime Converts a UTC date/time into local time in this time zone. Because of daylight savings time shifts, some local date/time values occur twice. The secondOccurrence parameter may be used to determine whether the time returned is the first or second occurrence of that time. name="utcDateTime" UTC date/time. An error occurs if utcDateTime.timeSpec() is not Qt.UTC. name="secondOccurrence" if non-null, returns true if the return value is the second occurrence of that time, else false
TransitionIndex ( QDateTime dt ) : int
TransitionIndex ( QDateTime dt, int &secondIndex ) : int
TransitionIndex ( QDateTime dt, int &secondIndex, bool &validTime ) : int Return all daylight saving transitions, in time order. If desired, the transitions returned may be restricted to a specified time range. Note that some time zone data sources (such as system time zones accessed via the system libraries) may not allow a list of daylight saving time changes to be compiled easily. In such cases, this method will return an empty list. name="start" start UTC date/time, or invalid date/time to return all transitions up to end. start.timeSpec() must be Qt.UTC, else start will be considered invalid. name="end" end UTC date/time, or invalid date/time for no end. end.timeSpec() must be Qt.UTC, else end will be considered invalid. Find the last daylight savings time transition at or before a given UTC or local time. Because of daylight savings time shifts, a local time may occur twice or may not occur at all. In the former case, the transitions at or before both occurrences of dt may optionally be calculated and returned in secondTransition. The latter case may optionally be detected by use of validTime. name="dt" date/time. dt.timeSpec() may be set to Qt.UTC or Qt.LocalTime. name="secondTransition" if non-null, and the dt occurs twice, receives the transition for the second occurrence. Otherwise, it is set the same as the return value. name="validTime" if non-null, is set to false if dt does not occur, or to true otherwise Find the index to the last daylight savings time transition at or before a given UTC or local time. The return value is the index into the transition list returned by transitions(). Because of daylight savings time shifts, a local time may occur twice or may not occur at all. In the former case, the transitions at or before both occurrences of dt may optionally be calculated and returned in secondIndex. The latter case may optionally be detected by use of validTime. name="dt" date/time. dt.timeSpec() may be set to Qt.UTC or Qt.LocalTime. name="secondIndex" if non-null, and the dt occurs twice, receives the index to the transition for the second occurrence. Otherwise, it is set the same as the return value. name="validTime" if non-null, is set to false if dt does not occur, or to true otherwise
TransitionTimes ( KTimeZone phase ) : List
TransitionTimes ( KTimeZone phase, QDateTime start ) : List
TransitionTimes ( KTimeZone phase, QDateTime start, QDateTime end ) : List Return the times of all daylight saving transitions to a given time zone phase, in time order. If desired, the times returned may be restricted to a specified time range. Note that some time zone data sources (such as system time zones accessed via the system libraries) may not allow a list of daylight saving time changes to be compiled easily. In such cases, this method will return an empty list. name="phase" time zone phase name="start" start UTC date/time, or invalid date/time to return all transitions up to end. start.timeSpec() must be Qt.UTC, else start will be considered invalid. name="end" end UTC date/time, or invalid date/time for no end. end.timeSpec() must be Qt.UTC, else end will be considered invalid.
UNKNOWN ( ) : float
UpdateBase ( KTimeZone other ) : bool Update the definition of the time zone to be identical to another KTimeZone instance. A prerequisite is that the two instances must have the same name. The main purpose of this method is to allow updates of the time zone definition by derived classes without invalidating pointers to the instance (particularly pointers held by KDateTime objects). Note that the KTimeZoneData object and KTimeZoneSource pointer are not updated: the caller class should do this itself by calling setData(). name="other" time zone whose definition is to be used
Utc ( ) : KTimeZone Returns a standard UTC time zone, with name "UTC". @note The KTimeZone returned by this method does not belong to any KTimeZones collection. Any KTimeZones instance may contain its own UTC KTimeZone defined by its time zone source data, but that will be a different instance than this KTimeZone.
UtcOffsets ( ) : List Returns the complete list of UTC offsets used by the time zone. This may include historical ones which are no longer in use or have been superseded. A UTC offset is the number of seconds which you must add to UTC to get local time in this time zone. If due to the nature of the source data for the time zone, compiling a complete list would require significant processing, an empty list is returned instead.
operator ( ) : bool
type ( ) : QByteArray Returns the class name of the data represented by this instance. If a derived class object has been assigned to this instance, this method will return the name of that class.

Protected Methods

Method Description
CreateProxy ( ) : void
KTimeZone ( Type dummy ) : System
SetData ( KTimeZoneData data ) : void
SetData ( KTimeZoneData data, KTimeZoneSource source ) : void Sets the detailed parsed data for the time zone, and optionally a new time zone source object. name="data" parsed data name="source" if non-null, the new source object for the time zone

Private Methods

Method Description
HasTransitions ( ) : bool
IsDst ( int t ) : bool
IsDstAtUtc ( QDateTime utcDateTime ) : bool
KTimeZone ( ) : System
Offset ( int t ) : int
OffsetAtUtc ( QDateTime utcDateTime ) : int
OffsetAtZoneTime ( QDateTime zoneDateTime ) : int
OffsetAtZoneTime ( QDateTime zoneDateTime, int &secondOffset ) : int

Method Details

Abbreviation() public method

Returns the time zone abbreviation current at a specified time. name="utcDateTime" UTC date/time. An error occurs if utcDateTime.timeSpec() is not Qt.UTC.
public Abbreviation ( Qyoto.QDateTime utcDateTime ) : Qyoto.QByteArray
utcDateTime Qyoto.QDateTime
return Qyoto.QByteArray

Abbreviations() public method

Returns the list of time zone abbreviations used by the time zone. This may include historical ones which are no longer in use or have been superseded.
public Abbreviations ( ) : List
return List

Comment() public method

Returns any comment for the time zone.
public Comment ( ) : string
return string

Convert() public method

Converts a date/time, which is interpreted as being local time in this time zone, into local time in another time zone. name="newZone" other time zone which the time is to be converted into name="zoneDateTime" local date/time. An error occurs if zoneDateTime.timeSpec() is not Qt.LocalTime.
public Convert ( KTimeZone newZone, Qyoto.QDateTime zoneDateTime ) : Qyoto.QDateTime
newZone KTimeZone
zoneDateTime Qyoto.QDateTime
return Qyoto.QDateTime

CountryCode() public method

Returns the two-letter country code of the time zone.
public CountryCode ( ) : string
return string

CreateProxy() protected method

protected CreateProxy ( ) : void
return void

CurrentOffset() public method

public CurrentOffset ( ) : int
return int

CurrentOffset() public method

Returns the current offset of this time zone to UTC or the local system time zone. The offset is the number of seconds which you must add to UTC or the local system time to get local time in this time zone. Take care if you cache the results of this routine; that would break if the result were stored across a daylight savings change. name="basis" Qt.UTC to return the offset to UTC, Qt.LocalTime to return the offset to local system time
public CurrentOffset ( Qt basis ) : int
basis Qyoto.Qt
return int

Data() public method

public Data ( ) : KTimeZoneData
return KTimeZoneData

Data() public method

Returns the detailed parsed data for the time zone. This will return null unless either parse() has been called beforehand, or create is true. name="create" true to parse the zone's data first if not already parsed
public Data ( bool create ) : KTimeZoneData
create bool
return KTimeZoneData

Dispose() public method

public Dispose ( ) : void
return void

Equals() public method

Checks whether this is the same instance as another one. Note that only the pointers to the time zone data are compared, not the contents. So it will only return equality if one instance was copied from the other. name="rhs" other instance
public Equals ( object o ) : bool
o object
return bool

FromTime_t() public static method

Converts a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2)), to a UTC QDateTime value. QDateTime.SetTime_t() is limited to handling t >= 0, since its parameter is unsigned. This method takes a parameter of time_t which is signed.
public static FromTime_t ( int t ) : QDateTime
t int
return QDateTime

GetHashCode() public method

public GetHashCode ( ) : int
return int

InvalidOffset() public static method

public static InvalidOffset ( ) : int
return int

InvalidTime_t() public static method

public static InvalidTime_t ( ) : int
return int

IsValid() public method

Checks whether the instance is valid.
public IsValid ( ) : bool
return bool

KTimeZone() public method

public KTimeZone ( KTimeZone tz ) : System
tz KTimeZone
return System

KTimeZone() public method

public KTimeZone ( KTimeZoneBackend impl ) : System
impl KTimeZoneBackend
return System

KTimeZone() protected method

protected KTimeZone ( Type dummy ) : System
dummy Type
return System

KTimeZone() public method

Constructs a UTC time zone. name="name" name of the UTC time zone
public KTimeZone ( string name ) : System
name string
return System

Latitude() public method

Returns the latitude of the time zone.
public Latitude ( ) : float
return float

LeapSecondChanges() public method

Return all leap second adjustments, in time order. Note that some time zone data sources (such as system time zones accessed via the system libraries) may not provide information on leap second adjustments. In such cases, this method will return an empty list.
public LeapSecondChanges ( ) : List
return List

Longitude() public method

Returns the latitude of the time zone.
public Longitude ( ) : float
return float

Name() public method

Returns the name of the time zone. If it is held in a KTimeZones container, the name is the time zone's unique identifier within that KTimeZones instance.
public Name ( ) : string
return string

Parse() public method

Extracts time zone detail information for this time zone from the source database.
public Parse ( ) : bool
return bool

Phases() public method

Return all daylight savings time phases for the time zone. Note that some time zone data sources (such as system time zones accessed via the system libraries) may not allow a list of daylight savings time changes to be compiled easily. In such cases, this method will return an empty list.
public Phases ( ) : List
return List

SetData() protected method

protected SetData ( KTimeZoneData data ) : void
data KTimeZoneData
return void

SetData() protected method

Sets the detailed parsed data for the time zone, and optionally a new time zone source object. name="data" parsed data name="source" if non-null, the new source object for the time zone
protected SetData ( KTimeZoneData data, KTimeZoneSource source ) : void
data KTimeZoneData
source KTimeZoneSource
return void

Source() public method

Returns the source reader/parser for the time zone's source database.
public Source ( ) : KTimeZoneSource
return KTimeZoneSource

ToTime_t() public static method

Converts a UTC QDateTime to a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2)). QDateTime.ToTime_t() returns an unsigned value. This method returns a time_t value, which is signed. name="utcDateTime" date/time. An error occurs if utcDateTime.timeSpec() is not Qt.UTC.
public static ToTime_t ( QDateTime utcDateTime ) : int
utcDateTime QDateTime
return int

ToUtc() public method

Converts a date/time, which is interpreted as local time in this time zone, into UTC. Because of daylight savings time shifts, the date/time may occur twice. In such cases, this method returns the UTC time for the first occurrence. If you need the UTC time of the second occurrence, use offsetAtZoneTime(). name="zoneDateTime" local date/time. An error occurs if zoneDateTime.timeSpec() is not Qt.LocalTime.
public ToUtc ( QDateTime zoneDateTime ) : QDateTime
zoneDateTime QDateTime
return QDateTime

ToZoneTime() public method

public ToZoneTime ( QDateTime utcDateTime ) : QDateTime
utcDateTime QDateTime
return QDateTime

ToZoneTime() public method

Converts a UTC date/time into local time in this time zone. Because of daylight savings time shifts, some local date/time values occur twice. The secondOccurrence parameter may be used to determine whether the time returned is the first or second occurrence of that time. name="utcDateTime" UTC date/time. An error occurs if utcDateTime.timeSpec() is not Qt.UTC. name="secondOccurrence" if non-null, returns true if the return value is the second occurrence of that time, else false
public ToZoneTime ( QDateTime utcDateTime, bool &secondOccurrence ) : QDateTime
utcDateTime QDateTime
secondOccurrence bool
return QDateTime

TransitionIndex() public method

public TransitionIndex ( QDateTime dt ) : int
dt QDateTime
return int

TransitionIndex() public method

public TransitionIndex ( QDateTime dt, int &secondIndex ) : int
dt QDateTime
secondIndex int
return int

TransitionIndex() public method

Return all daylight saving transitions, in time order. If desired, the transitions returned may be restricted to a specified time range. Note that some time zone data sources (such as system time zones accessed via the system libraries) may not allow a list of daylight saving time changes to be compiled easily. In such cases, this method will return an empty list. name="start" start UTC date/time, or invalid date/time to return all transitions up to end. start.timeSpec() must be Qt.UTC, else start will be considered invalid. name="end" end UTC date/time, or invalid date/time for no end. end.timeSpec() must be Qt.UTC, else end will be considered invalid. Find the last daylight savings time transition at or before a given UTC or local time. Because of daylight savings time shifts, a local time may occur twice or may not occur at all. In the former case, the transitions at or before both occurrences of dt may optionally be calculated and returned in secondTransition. The latter case may optionally be detected by use of validTime. name="dt" date/time. dt.timeSpec() may be set to Qt.UTC or Qt.LocalTime. name="secondTransition" if non-null, and the dt occurs twice, receives the transition for the second occurrence. Otherwise, it is set the same as the return value. name="validTime" if non-null, is set to false if dt does not occur, or to true otherwise Find the index to the last daylight savings time transition at or before a given UTC or local time. The return value is the index into the transition list returned by transitions(). Because of daylight savings time shifts, a local time may occur twice or may not occur at all. In the former case, the transitions at or before both occurrences of dt may optionally be calculated and returned in secondIndex. The latter case may optionally be detected by use of validTime. name="dt" date/time. dt.timeSpec() may be set to Qt.UTC or Qt.LocalTime. name="secondIndex" if non-null, and the dt occurs twice, receives the index to the transition for the second occurrence. Otherwise, it is set the same as the return value. name="validTime" if non-null, is set to false if dt does not occur, or to true otherwise
public TransitionIndex ( QDateTime dt, int &secondIndex, bool &validTime ) : int
dt QDateTime
secondIndex int
validTime bool
return int

TransitionTimes() public method

public TransitionTimes ( KTimeZone phase ) : List
phase KTimeZone
return List

TransitionTimes() public method

public TransitionTimes ( KTimeZone phase, QDateTime start ) : List
phase KTimeZone
start QDateTime
return List

TransitionTimes() public method

Return the times of all daylight saving transitions to a given time zone phase, in time order. If desired, the times returned may be restricted to a specified time range. Note that some time zone data sources (such as system time zones accessed via the system libraries) may not allow a list of daylight saving time changes to be compiled easily. In such cases, this method will return an empty list. name="phase" time zone phase name="start" start UTC date/time, or invalid date/time to return all transitions up to end. start.timeSpec() must be Qt.UTC, else start will be considered invalid. name="end" end UTC date/time, or invalid date/time for no end. end.timeSpec() must be Qt.UTC, else end will be considered invalid.
public TransitionTimes ( KTimeZone phase, QDateTime start, QDateTime end ) : List
phase KTimeZone
start QDateTime
end QDateTime
return List

UNKNOWN() public static method

public static UNKNOWN ( ) : float
return float

UpdateBase() public method

Update the definition of the time zone to be identical to another KTimeZone instance. A prerequisite is that the two instances must have the same name. The main purpose of this method is to allow updates of the time zone definition by derived classes without invalidating pointers to the instance (particularly pointers held by KDateTime objects). Note that the KTimeZoneData object and KTimeZoneSource pointer are not updated: the caller class should do this itself by calling setData(). name="other" time zone whose definition is to be used
public UpdateBase ( KTimeZone other ) : bool
other KTimeZone
return bool

Utc() public static method

Returns a standard UTC time zone, with name "UTC". @note The KTimeZone returned by this method does not belong to any KTimeZones collection. Any KTimeZones instance may contain its own UTC KTimeZone defined by its time zone source data, but that will be a different instance than this KTimeZone.
public static Utc ( ) : KTimeZone
return KTimeZone

UtcOffsets() public method

Returns the complete list of UTC offsets used by the time zone. This may include historical ones which are no longer in use or have been superseded. A UTC offset is the number of seconds which you must add to UTC to get local time in this time zone. If due to the nature of the source data for the time zone, compiling a complete list would require significant processing, an empty list is returned instead.
public UtcOffsets ( ) : List
return List

operator() public static method

public static operator ( ) : bool
return bool

type() public method

Returns the class name of the data represented by this instance. If a derived class object has been assigned to this instance, this method will return the name of that class.
public type ( ) : QByteArray
return QByteArray

Property Details

interceptor protected_oe property

protected SmokeInvocation interceptor
return SmokeInvocation