32#include <QtCore/QMetaType>
33#include <QtCore/QSharedDataPointer>
36class KDateTimePrivate;
37class KDateTimeSpecPrivate;
268 bool isValid()
const;
300 bool isLocalZone()
const;
308 bool isClockTime()
const;
327 bool isOffsetFromUtc()
const;
336 int utcOffset()
const;
347 void setType(
SpecType type,
int utcOffset = 0);
383 bool equivalentTo(
const Spec &other)
const;
395 static Spec ClockTime();
404 static Spec OffsetFromUTC(
int utcOffset);
412 static Spec LocalZone();
415 KDateTimeSpecPrivate*
const d;
498 Equal = AtStart | Inside | AtEnd,
501 Outside = Before | AtStart | Inside | AtEnd | After,
506 StartsAt = AtStart | Inside | AtEnd | After,
511 EndsAt = Before | AtStart | Inside | AtEnd
541 explicit KDateTime(
const QDate &date,
const Spec &spec = Spec(LocalZone));
560 KDateTime(
const QDate &date,
const QTime &time,
const Spec &spec = Spec(LocalZone));
621 bool isValid()
const;
628 bool isDateOnly()
const;
679 Spec timeSpec()
const;
690 SpecType timeType()
const;
699 bool isLocalZone()
const;
707 bool isClockTime()
const;
727 bool isOffsetFromUtc()
const;
736 int utcOffset()
const;
756 bool isSecondOccurrence()
const;
800 KDateTime toOffsetFromUtc(
int utcOffset)
const;
848 KDateTime toTimeSpec(
const Spec &spec)
const;
870 uint toTime_t()
const;
879 void setTime_t(
qint64 seconds);
890 void setDateOnly(
bool dateOnly);
898 void setDate(
const QDate &date);
907 void setTime(
const QTime &time);
936 void setTimeSpec(
const Spec &spec);
961 void setSecondOccurrence(
bool second);
1070 int secsTo(
const KDateTime &other)
const;
1122 int daysTo(
const KDateTime &other)
const;
1131 static KDateTime currentLocalDateTime();
1154 static KDateTime currentDateTime(
const Spec &spec);
1164 static QDate currentLocalDate();
1174 static QTime currentLocalTime();
1266 QString toString(TimeFormat format = ISODate)
const;
1308 static KDateTime fromString(
const QString &
string, TimeFormat format = ISODate,
bool *negZero = 0);
1448 const KTimeZones *zones = 0,
bool offsetIfAmbiguous =
true);
1462 static void setFromStringDefault(
const Spec &spec);
1476 bool outOfRange()
const;
1506 Comparison compare(
const KDateTime &other)
const;
1600 static void setSimulatedSystemTime(
const KDateTime& newTime);
1619 static KDateTime realCurrentLocalDateTime();
1621 friend QDataStream KDECORE_EXPORT &
operator<<(QDataStream &out,
const KDateTime &dateTime);
1625 QSharedDataPointer<KDateTimePrivate> d;
The full time specification of a KDateTime instance.
bool operator!=(const Spec &other) const
A class representing a date and time with an associated time zone.
bool operator<=(const KDateTime &other) const
bool operator!=(const KDateTime &other) const
Comparison
How this KDateTime compares with another.
bool operator>=(const KDateTime &other) const
TimeFormat
Format for strings representing date/time values.
SpecType
The time specification type of a KDateTime instance.
@ Invalid
an invalid time specification.
@ OffsetFromUTC
a local time which has a fixed offset from UTC.
bool operator>(const KDateTime &other) const
Base class representing a time zone.
The KTimeZones class represents a time zone database which consists of a collection of individual tim...
QDebug operator<<(QDebug dbg, const KEntryKey &key)
bool operator==(const KEntry &k1, const KEntry &k2)
bool operator<(const KEntryKey &k1, const KEntryKey &k2)
Compares two KEntryKeys (needed for QMap).
QDataStream & operator>>(QDataStream &s, KDateTime::Spec &spec)
Read a KDateTime::Spec object into spec from in, in binary format.
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Write spec to the datastream out, in binary format.
QDataStream & operator>>(QDataStream &in, KDateTime::Spec &spec)
Read a KDateTime::Spec object into spec from in, in binary format.