C# Класс Kimono.KTimeZone

Наследование: Object, IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
interceptor SmokeInvocation

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Abbreviation() публичный Метод

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
Результат Qyoto.QByteArray

Abbreviations() публичный Метод

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
Результат List

Comment() публичный Метод

Returns any comment for the time zone.
public Comment ( ) : string
Результат string

Convert() публичный Метод

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
Результат Qyoto.QDateTime

CountryCode() публичный Метод

Returns the two-letter country code of the time zone.
public CountryCode ( ) : string
Результат string

CreateProxy() защищенный Метод

protected CreateProxy ( ) : void
Результат void

CurrentOffset() публичный Метод

public CurrentOffset ( ) : int
Результат int

CurrentOffset() публичный Метод

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
Результат int

Data() публичный Метод

public Data ( ) : KTimeZoneData
Результат KTimeZoneData

Data() публичный Метод

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
Результат KTimeZoneData

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Equals() публичный Метод

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
Результат bool

FromTime_t() публичный статический Метод

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
Результат QDateTime

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

InvalidOffset() публичный статический Метод

public static InvalidOffset ( ) : int
Результат int

InvalidTime_t() публичный статический Метод

public static InvalidTime_t ( ) : int
Результат int

IsValid() публичный Метод

Checks whether the instance is valid.
public IsValid ( ) : bool
Результат bool

KTimeZone() публичный Метод

public KTimeZone ( KTimeZone tz ) : System
tz KTimeZone
Результат System

KTimeZone() публичный Метод

public KTimeZone ( KTimeZoneBackend impl ) : System
impl KTimeZoneBackend
Результат System

KTimeZone() защищенный Метод

protected KTimeZone ( Type dummy ) : System
dummy Type
Результат System

KTimeZone() публичный Метод

Constructs a UTC time zone. name="name" name of the UTC time zone
public KTimeZone ( string name ) : System
name string
Результат System

Latitude() публичный Метод

Returns the latitude of the time zone.
public Latitude ( ) : float
Результат float

LeapSecondChanges() публичный Метод

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
Результат List

Longitude() публичный Метод

Returns the latitude of the time zone.
public Longitude ( ) : float
Результат float

Name() публичный Метод

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
Результат string

Parse() публичный Метод

Extracts time zone detail information for this time zone from the source database.
public Parse ( ) : bool
Результат bool

Phases() публичный Метод

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
Результат List

SetData() защищенный Метод

protected SetData ( KTimeZoneData data ) : void
data KTimeZoneData
Результат void

SetData() защищенный Метод

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
Результат void

Source() публичный Метод

Returns the source reader/parser for the time zone's source database.
public Source ( ) : KTimeZoneSource
Результат KTimeZoneSource

ToTime_t() публичный статический Метод

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
Результат int

ToUtc() публичный Метод

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
Результат QDateTime

ToZoneTime() публичный Метод

public ToZoneTime ( QDateTime utcDateTime ) : QDateTime
utcDateTime QDateTime
Результат QDateTime

ToZoneTime() публичный Метод

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
Результат QDateTime

TransitionIndex() публичный Метод

public TransitionIndex ( QDateTime dt ) : int
dt QDateTime
Результат int

TransitionIndex() публичный Метод

public TransitionIndex ( QDateTime dt, int &secondIndex ) : int
dt QDateTime
secondIndex int
Результат int

TransitionIndex() публичный Метод

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
Результат int

TransitionTimes() публичный Метод

public TransitionTimes ( KTimeZone phase ) : List
phase KTimeZone
Результат List

TransitionTimes() публичный Метод

public TransitionTimes ( KTimeZone phase, QDateTime start ) : List
phase KTimeZone
start QDateTime
Результат List

TransitionTimes() публичный Метод

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
Результат List

UNKNOWN() публичный статический Метод

public static UNKNOWN ( ) : float
Результат float

UpdateBase() публичный Метод

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
Результат bool

Utc() публичный статический Метод

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
Результат KTimeZone

UtcOffsets() публичный Метод

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
Результат List

operator() публичный статический Метод

public static operator ( ) : bool
Результат bool

type() публичный Метод

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
Результат QByteArray

Описание свойств

interceptor защищенное свойство

protected SmokeInvocation interceptor
Результат SmokeInvocation