KDECore
ktimezone.cpp
Go to the documentation of this file.
296 bool transitionIndexes(const QDateTime &start, const QDateTime &end, int &ixstart, int &ixend) const;
322 int refCount; // holds the number of KTimeZoneBackend instances using the KTimeZonePrivate instance as a d-pointer.
376 // Changing the contents of a KTimeZonePrivate instance by means of operator=() doesn't affect how
424 : d(new KTimeZonePrivate(KTimeZonePrivate::utcSource(), name, QString(), KTimeZone::UNKNOWN, KTimeZone::UNKNOWN, QString()))
467 int KTimeZoneBackend::offsetAtZoneTime(const KTimeZone* caller, const QDateTime &zoneDateTime, int *secondOffset) const
469 if (!zoneDateTime.isValid() || zoneDateTime.timeSpec() != Qt::LocalTime) // check for invalid time
485 const int preoffset = (index > 0) ? transitions[index - 1].phase().utcOffset() : d->data ? d->data->previousUtcOffset() : 0;
490 d->cachedTransitionEndZoneTime = transitions[index + 1].time().addSecs(qMin(offset, postoffset));
707 QList<KTimeZone::Transition> KTimeZone::transitions(const QDateTime &start, const QDateTime &end) const
714 const KTimeZone::Transition *KTimeZone::transition(const QDateTime &dt, const Transition **secondTransition,
735 QList<QDateTime> KTimeZone::transitionTimes(const Phase &phase, const QDateTime &start, const QDateTime &end) const
828 const int secs = (index >= 0) ? data->transitions().at(index).phase().utcOffset() : data->previousUtcOffset();
1100 bool KTimeZoneDataPrivate::transitionIndexes(const QDateTime &start, const QDateTime &end, int &ixstart, int &ixend) const
1128 bool KTimeZoneDataPrivate::isSecondOccurrence(const QDateTime &utcLocalTime, int transitionIndex) const
1133 const int prevoffset = (transitionIndex > 0) ? transitions[transitionIndex-1].phase().utcOffset() : prePhase.utcOffset();
1138 const qint64 afterStart = transitions[transitionIndex].time().msecsTo(utcLocalTime)/1000 - offset;
1232 void KTimeZoneData::setPhases(const QList<KTimeZone::Phase> &phases, const KTimeZone::Phase& previousPhase)
1249 QList<KTimeZone::Transition> KTimeZoneData::transitions(const QDateTime &start, const QDateTime &end) const
1271 const KTimeZone::Transition *KTimeZoneData::transition(const QDateTime &dt, const KTimeZone::Transition **secondTransition,
1281 int KTimeZoneData::transitionIndex(const QDateTime &dt, int *secondIndex, bool *validTime) const
1307 const int offset = (index >= 0) ? d->transitions[index].phase().utcOffset() : d->prePhase.utcOffset();
1358 QList<QDateTime> KTimeZoneData::transitionTimes(const KTimeZone::Phase &phase, const QDateTime &start, const QDateTime &end) const
int daysTo(const QDate &d) const
bool useZoneParse() const
Return whether the source database supports the ad hoc extraction of data for individual time zones u...
Definition: ktimezone.cpp:982
virtual int offsetAtUtc(const QDateTime &utcDateTime) const
Returns the offset of this time zone to UTC at the given UTC date/time.
Definition: ktimezone.cpp:870
int currentOffset(Qt::TimeSpec basis=Qt::UTC) const
Returns the current offset of this time zone to UTC or the local system time zone.
Definition: ktimezone.cpp:880
static QDateTime fromTime_t(time_t t)
Converts a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2))...
Definition: ktimezone.cpp:917
bool parse() const
Extracts time zone detail information for this time zone from the source database.
Definition: ktimezone.cpp:784
int transitionIndex(const QDateTime &dt, int *secondIndex=0, bool *validTime=0) const
Find the index to the last daylight savings time transition at or before a given UTC or local time...
Definition: ktimezone.cpp:1281
virtual bool hasTransitions(const KTimeZone *caller) const
Implements KTimeZone::hasTransitions().
Definition: ktimezone.cpp:582
const KTimeZone::Transition * transition(const QDateTime &dt, const Transition **secondTransition=0, bool *validTime=0) const
Find the last daylight savings time transition at or before a given UTC or local time.
Definition: ktimezone.cpp:714
virtual QByteArray type() const
Returns the class name of the data represented by this instance.
Definition: ktimezone.cpp:457
void setPhases(const QList< KTimeZone::Phase > &phases, const KTimeZone::Phase &previousPhase)
Initialise the daylight savings time phase list.
Definition: ktimezone.cpp:1232
bool isDst() const
Return whether daylight savings time applies during this phase.
Definition: ktimezone.cpp:220
LeapSeconds & operator=(const LeapSeconds &c)
Definition: ktimezone.cpp:1028
Base class for the parsed data returned by a KTimeZoneSource class.
Definition: ktimezone.h:1302
Transitions transitions(const TIME_ZONE_INFORMATION &tz, int year)
Definition: ktimezone_win.cpp:368
virtual int offsetAtZoneTime(const KTimeZone *caller, const QDateTime &zoneDateTime, int *secondOffset) const
Implements KTimeZone::offsetAtZoneTime().
Definition: ktimezone.cpp:467
#define K_GLOBAL_STATIC(TYPE, NAME)
This macro makes it easy to use non-POD types as global statics.
Definition: kglobal.h:221
const T & at(int i) const
void setLeapSecondChanges(const QList< KTimeZone::LeapSeconds > &adjusts)
Initialise the leap seconds adjustment list.
Definition: ktimezone.cpp:1380
QTime time() const
virtual KTimeZoneData * parse(const KTimeZone &zone) const
Extracts detail information for one time zone from the source database.
Definition: ktimezone.cpp:976
void setTransitions(const QList< KTimeZone::Transition > &transitions)
Initialise the daylight savings time transition list.
Definition: ktimezone.cpp:1261
QDateTime toZoneTime(const QDateTime &utcDateTime, bool *secondOccurrence=0) const
Converts a UTC date/time into local time in this time zone.
Definition: ktimezone.cpp:808
KTimeZone remove(const KTimeZone &zone)
Removes a time zone from the collection.
Definition: ktimezone.cpp:82
virtual bool hasTransitions() const
Return whether daylight saving transitions are available for the time zone.
Definition: ktimezone.cpp:702
KTimeZone::LeapSeconds leapSecondChange(const QDateTime &utc) const
Find the leap second adjustment which is applicable at a given UTC time.
Definition: ktimezone.cpp:1385
QList< KTimeZone::Transition > transitions(const QDateTime &start=QDateTime(), const QDateTime &end=QDateTime()) const
Return all daylight saving transitions, in time order.
Definition: ktimezone.cpp:1249
KTimeZoneSource * source() const
Returns the source reader/parser for the time zone's source database.
Definition: ktimezone.cpp:749
Definition: ktimezone.h:429
void setTimeSpec(Qt::TimeSpec spec)
virtual KTimeZoneData * clone() const
Creates a new copy of this object.
Definition: ktimezone.cpp:1175
int count(const T &value) const
QString countryCode() const
Returns the two-letter country code of the time zone.
Definition: ktimezone.cpp:649
const KTimeZoneData * data(bool create=false) const
Returns the detailed parsed data for the time zone.
Definition: ktimezone.cpp:754
static time_t toTime_t(const QDateTime &utcDateTime)
Converts a UTC QDateTime to a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as r...
Definition: ktimezone.cpp:934
KTimeZoneBackend & operator=(const KTimeZoneBackend &other)
Definition: ktimezone.cpp:445
Phase phase() const
Return the time zone phase which takes effect after the transition.
Definition: ktimezone.cpp:278
QByteArray type() const
Returns the class name of the data represented by this instance.
Definition: ktimezone.cpp:639
QByteArray abbreviation(const QDateTime &utcDateTime) const
Returns the time zone abbreviation current at a specified time.
Definition: ktimezone.cpp:681
virtual KTimeZoneBackend * clone() const
Creates a copy of this instance.
Definition: ktimezone.cpp:462
QList< Phase > phases() const
Return all daylight savings time phases for the time zone.
Definition: ktimezone.cpp:695
static const float UNKNOWN
A representation for unknown locations; this is a float that does not represent a real latitude or lo...
Definition: ktimezone.h:1083
bool operator<(const LeapSeconds &c) const
Definition: ktimezone.cpp:1036
bool isEmpty() const
bool isEmpty() const
Definition: ktimezone.h:560
virtual QList< QByteArray > abbreviations() const
Returns the complete list of time zone abbreviations.
Definition: ktimezone.cpp:1180
void setData(KTimeZoneData *data, KTimeZoneSource *source=0)
Sets the detailed parsed data for the time zone, and optionally a new time zone source object...
Definition: ktimezone.cpp:763
QTime addSecs(int s) const
QList< QDateTime > transitionTimes(const KTimeZone::Phase &phase, const QDateTime &start=QDateTime(), const QDateTime &end=QDateTime()) const
Return the times of all daylight saving transitions to a given time zone phase, in time order...
Definition: ktimezone.cpp:1358
virtual bool isDst(const KTimeZone *caller, time_t t) const
Implements KTimeZone::isDst().
Definition: ktimezone.cpp:577
bool updateBase(const KTimeZone &other)
Update the definition of the time zone to be identical to another KTimeZone instance.
Definition: ktimezone.cpp:773
Transition & operator=(const KTimeZone::Transition &t)
Definition: ktimezone.cpp:265
QList< KTimeZone::LeapSeconds > leapSecondChanges() const
Return all leap second adjustments, in time order.
Definition: ktimezone.cpp:1375
Time zone functions.
QList< QByteArray > abbreviations() const
Return the time zone abbreviations which apply to this phase.
Definition: ktimezone.cpp:215
QString comment() const
Return the comment (if any) applying to this change.
Definition: ktimezone.cpp:1056
QDateTime toUtc(const QDateTime &zoneDateTime) const
Converts a date/time, which is interpreted as local time in this time zone, into UTC.
Definition: ktimezone.cpp:796
int leapSeconds() const
Return the cumulative number of leap seconds to be added after this change occurs.
Definition: ktimezone.cpp:1051
Qt::TimeSpec timeSpec() const
bool operator<(const Transition &rhs) const
Compare the date/time values of two transitions.
Definition: ktimezone.cpp:272
bool isValid() const
QList< LeapSeconds > leapSecondChanges() const
Return all leap second adjustments, in time order.
Definition: ktimezone.cpp:742
const KTimeZone::Transition * transition(const QDateTime &dt, const KTimeZone::Transition **secondTransition=0, bool *validTime=0) const
Find the last daylight savings time transition at or before a given UTC or local time.
Definition: ktimezone.cpp:1271
QDate date() const
int previousUtcOffset() const
Returns the UTC offset to use before the start of data for the time zone.
Definition: ktimezone.cpp:1266
virtual bool isDst(time_t t) const
Returns whether daylight savings time is in operation at a specified UTC time.
Definition: ktimezone.cpp:906
QDateTime convert(const KTimeZone &newZone, const QDateTime &zoneDateTime) const
Converts a date/time, which is interpreted as being local time in this time zone, into local time in ...
Definition: ktimezone.cpp:854
QList< QDateTime > transitionTimes(const Phase &phase, const QDateTime &start=QDateTime(), const QDateTime &end=QDateTime()) const
Return the times of all daylight saving transitions to a given time zone phase, in time order...
Definition: ktimezone.cpp:735
QString comment() const
Return the comment (if any) applying to this phase.
Definition: ktimezone.cpp:225
KTimeZoneData & operator=(const KTimeZoneData &c)
Definition: ktimezone.cpp:1164
bool operator==(const KTimeZone &rhs) const
Checks whether this is the same instance as another one.
Definition: ktimezone.cpp:634
virtual bool isDstAtUtc(const QDateTime &utcDateTime) const
Returns whether daylight savings time is in operation at the given UTC date/time. ...
Definition: ktimezone.cpp:901
QList< KTimeZone::Transition > transitions(const QDateTime &start=QDateTime(), const QDateTime &end=QDateTime()) const
Return all daylight saving transitions, in time order.
Definition: ktimezone.cpp:707
int utcOffset() const
Return the UTC offset in seconds during this phase.
Definition: ktimezone.cpp:210
QList< KTimeZone::Phase > phases() const
Return all daylight savings time phases.
Definition: ktimezone.cpp:1227
virtual int offsetAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
Implements KTimeZone::offsetAtUtc().
Definition: ktimezone.cpp:530
virtual QList< int > utcOffsets() const
Returns the complete list of UTC offsets for the time zone, if the time zone's source makes such info...
Definition: ktimezone.cpp:1209
Definition: ktimezone.h:513
QDate addDays(int ndays) const
typedef Iterator
const ZoneMap zones() const
Returns all the time zones defined in this collection.
Definition: ktimezone.cpp:67
virtual int offset(time_t t) const
Returns the offset of this time zone to UTC at a specified UTC time.
Definition: ktimezone.cpp:875
QDateTime addSecs(int s) const
typedef ConstIterator
virtual int offset(const KTimeZone *caller, time_t t) const
Implements KTimeZone::offset().
Definition: ktimezone.cpp:562
Base class representing a source of time zone information.
Definition: ktimezone.h:1230
QList< int > utcOffsets() const
Returns the complete list of UTC offsets used by the time zone.
Definition: ktimezone.cpp:688
QList< QByteArray > abbreviations() const
Returns the list of time zone abbreviations used by the time zone.
Definition: ktimezone.cpp:674
virtual int offsetAtZoneTime(const QDateTime &zoneDateTime, int *secondOffset=0) const
Returns the offset of this time zone to UTC at the given local date/time.
Definition: ktimezone.cpp:865
QDateTime dateTime() const
Return the UTC date/time when this change occurred.
Definition: ktimezone.cpp:1041
virtual QByteArray abbreviation(const QDateTime &utcDateTime) const
Returns the time zone abbreviation current at a specified time.
Definition: ktimezone.cpp:1197
int secsTo(const QTime &t) const
int transitionIndex(const QDateTime &dt, int *secondIndex=0, bool *validTime=0) const
Find the index to the last daylight savings time transition at or before a given UTC or local time...
Definition: ktimezone.cpp:725
static KTimeZone utc()
Returns a standard UTC time zone, with name "UTC".
Definition: ktimezone.cpp:911
virtual bool isDstAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
Implements KTimeZone::isDstAtUtc().
Definition: ktimezone.cpp:567
KTimeZone zone(const QString &name) const
Returns the time zone with the given name.
Definition: ktimezone.cpp:118
qint64 msecsTo(const QDateTime &other) const
virtual bool hasTransitions() const
Return whether daylight saving transitions are available for the time zone.
Definition: ktimezone.cpp:1244
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.