8#include <QtCore/qcompare.h>
9#include <QtCore/qdatetime.h>
10#include <QtCore/qlocale.h>
11#include <QtCore/qswap.h>
12#include <QtCore/qtclasshelpermacros.h>
16#if QT_CONFIG(timezone) && (defined(Q_OS_DARWIN) || defined(Q_QDOC))
29#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
34#if Q_BYTE_ORDER == Q_BIG_ENDIAN
43#if Q_BYTE_ORDER == Q_BIG_ENDIAN
45 mode((
int(spec) + 1) & 3)
47 :
mode((
int(spec) + 1) & 3),
52 friend constexpr bool operator==(ShortData lhs, ShortData rhs)
53 {
return lhs.mode == rhs.mode && lhs.offset == rhs.offset; }
60 Data(ShortData sd) :
s(sd) {}
63 Data &operator=(
const Data &
other)
noexcept;
64 Data &operator=(Data &&
other)
noexcept {
swap(
other);
return *
this; }
69 bool isShort()
const {
return s.mode; }
72 template <
typename Stream,
typename Wrap>
73 void serialize(Stream &
out,
const Wrap &
wrap)
const;
87 static constexpr int MinUtcOffsetSecs = -16 * 3600;
90 static constexpr int MaxUtcOffsetSecs = +16 * 3600;
100#if QT_CONFIG(timezone)
113 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(
QTimeZone)
118#if QT_CORE_REMOVED_SINCE(6, 7)
123 bool isValid()
const;
134 return fromDurationAheadOfUtc(std::chrono::seconds{
offset});
144#if QT_CONFIG(timezone)
164 int standardTimeOffset;
165 int daylightTimeOffset;
167 typedef QList<OffsetData> OffsetDataList;
171# if QT_DEPRECATED_SINCE(6, 6)
173 QLocale::Country country() const;
178 QTimeZone::NameType nameType = QTimeZone::DefaultName,
181 QTimeZone::NameType nameType = QTimeZone::DefaultName,
185 int offsetFromUtc(
const QDateTime &atDateTime)
const;
186 int standardTimeOffset(
const QDateTime &atDateTime)
const;
187 int daylightTimeOffset(
const QDateTime &atDateTime)
const;
189 bool hasDaylightTime()
const;
190 bool isDaylightTime(
const QDateTime &atDateTime)
const;
192 OffsetData offsetData(
const QDateTime &forDateTime)
const;
194 bool hasTransitions()
const;
195 OffsetData nextTransition(
const QDateTime &afterDateTime)
const;
196 OffsetData previousTransition(
const QDateTime &beforeDateTime)
const;
197 OffsetDataList transitions(
const QDateTime &fromDateTime,
const QDateTime &toDateTime)
const;
203 static bool isTimeZoneIdAvailable(
const QByteArray &ianaId);
205 static QList<QByteArray> availableTimeZoneIds();
207 static QList<QByteArray> availableTimeZoneIds(
int offsetSeconds);
213 static QList<QByteArray> windowsIdToIanaIds(
const QByteArray &windowsId);
214 static QList<QByteArray> windowsIdToIanaIds(
const QByteArray &windowsId,
217# if defined(Q_OS_DARWIN) || defined(Q_QDOC)
218 static QTimeZone fromCFTimeZone(CFTimeZoneRef timeZone);
220 static
QTimeZone fromNSTimeZone(const NSTimeZone *timeZone);
224# if __cpp_lib_chrono >= 201907L || defined(Q_QDOC)
226 static QTimeZone fromStdTimeZonePtr(
const std::chrono::time_zone *timeZone)
230 const std::string_view timeZoneName = timeZone->name();
239#ifndef QT_NO_DATASTREAM
242#ifndef QT_NO_DEBUG_STREAM
252#if QT_CONFIG(timezone)
257#ifndef QT_NO_DATASTREAM
262#ifndef QT_NO_DEBUG_STREAM
266#if QT_CONFIG(timezone) && __cpp_lib_chrono >= 201907L
269inline QDateTime QDateTime::fromStdZonedTime(
const std::chrono::zoned_time<
270 std::chrono::milliseconds,
271 const std::chrono::time_zone *
274 const auto sysTime =
time.get_sys_time();
275 const QTimeZone timeZone = QTimeZone::fromStdTimeZonePtr(
time.get_time_zone());
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
static QDateTime fromMSecsSinceEpoch(qint64 msecs, const QTimeZone &timeZone)
QTime time() const
Returns the time part of the datetime.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static constexpr bool isUtcOrFixedOffset(Qt::TimeSpec spec) noexcept
constexpr int fixedSecondsAheadOfUtc() const noexcept
static QTimeZone fromSecondsAheadOfUtc(int offset)
static QTimeZone fromDurationAheadOfUtc(std::chrono::seconds offset)
Returns a time representation at a fixed offset, in seconds, ahead of UTC.
constexpr bool isUtcOrFixedOffset() const noexcept
constexpr Qt::TimeSpec timeSpec() const noexcept
QTimeZone(QTimeZone &&other) noexcept
Move constructor of this from other.
Combined button and popup list for selecting options.
void toByteArray(QByteArray &)
static QString displayName(CGDirectDisplayID displayID)
#define Q_DECLARE_EQUALITY_COMPARABLE(...)
#define QT_POST_CXX17_API_IN_EXPORTED_CLASS
#define Q_DECL_NS_RETURNS_AUTORELEASED
#define Q_DECL_CF_RETURNS_RETAINED
constexpr bool operator!=(const timespec &t1, const timespec &t2)
#define Q_FORWARD_DECLARE_CF_TYPE(type)
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
QDateTimePrivate::QDateTimeShortData ShortData
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
bool comparesEqual(const QDir &lhs, const QDir &rhs)
GLenum GLuint GLintptr offset
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static QT_BEGIN_NAMESPACE QAsn1Element wrap(quint8 type, const QAsn1Element &child)
constexpr void qt_ptr_swap(T *&lhs, T *&rhs) noexcept
#define QT_DEPRECATED_VERSION_X_6_6(text)
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &ds, const QTimeZone &tz)
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &ds, QTimeZone &tz)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
static double UTC(double t, double localTZA)
static double LocalTime(double t, double localTZA)
QTextStream out(stdout)
[7]