8#include <QtCore/qdatetime.h>
9#include <QtCore/qlocale.h>
10#include <QtCore/qswap.h>
11#include <QtCore/qtclasshelpermacros.h>
15#if QT_CONFIG(timezone) && (defined(Q_OS_DARWIN) || defined(Q_QDOC)) && !defined(QT_NO_SYSTEMLOCALE)
28#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
33#if Q_BYTE_ORDER == Q_BIG_ENDIAN
42#if Q_BYTE_ORDER == Q_BIG_ENDIAN
44 mode((
int(spec) + 1) & 3)
46 :
mode((
int(spec) + 1) & 3),
52 {
return lhs.mode == rhs.mode && lhs.offset == rhs.offset; }
68 bool isShort()
const {
return s.mode; }
71 template <
typename Stream,
typename Wrap>
72 void serialize(Stream &
out,
const Wrap &
wrap)
const;
86 static constexpr int MinUtcOffsetSecs = -16 * 3600;
89 static constexpr int MaxUtcOffsetSecs = +16 * 3600;
99#if QT_CONFIG(timezone)
112 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(
QTimeZone)
120 bool isValid()
const;
131 return fromDurationAheadOfUtc(std::chrono::seconds{
offset});;
141#if QT_CONFIG(timezone)
161 int standardTimeOffset;
162 int daylightTimeOffset;
168# if QT_DEPRECATED_SINCE(6, 6)
170 QLocale::Country country() const;
175 QTimeZone::NameType nameType = QTimeZone::DefaultName,
178 QTimeZone::NameType nameType = QTimeZone::DefaultName,
182 int offsetFromUtc(
const QDateTime &atDateTime)
const;
183 int standardTimeOffset(
const QDateTime &atDateTime)
const;
184 int daylightTimeOffset(
const QDateTime &atDateTime)
const;
186 bool hasDaylightTime()
const;
187 bool isDaylightTime(
const QDateTime &atDateTime)
const;
189 OffsetData offsetData(
const QDateTime &forDateTime)
const;
191 bool hasTransitions()
const;
192 OffsetData nextTransition(
const QDateTime &afterDateTime)
const;
193 OffsetData previousTransition(
const QDateTime &beforeDateTime)
const;
194 OffsetDataList transitions(
const QDateTime &fromDateTime,
const QDateTime &toDateTime)
const;
200 static bool isTimeZoneIdAvailable(
const QByteArray &ianaId);
214# if (defined(Q_OS_DARWIN) || defined(Q_QDOC)) && !defined(QT_NO_SYSTEMLOCALE)
215 static QTimeZone fromCFTimeZone(CFTimeZoneRef timeZone);
217 static
QTimeZone fromNSTimeZone(const NSTimeZone *timeZone);
221# if __cpp_lib_chrono >= 201907L || defined(Q_QDOC)
223 static QTimeZone fromStdTimeZonePtr(
const std::chrono::time_zone *timeZone)
227 const std::string_view timeZoneName = timeZone->name();
233#ifndef QT_NO_DATASTREAM
236#ifndef QT_NO_DEBUG_STREAM
246#if QT_CONFIG(timezone)
251#ifndef QT_NO_DATASTREAM
256#ifndef QT_NO_DEBUG_STREAM
260#if QT_CONFIG(timezone) && __cpp_lib_chrono >= 201907L
263inline QDateTime QDateTime::fromStdZonedTime(
const std::chrono::zoned_time<
264 std::chrono::milliseconds,
265 const std::chrono::time_zone *
268 const auto sysTime =
time.get_sys_time();
269 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 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
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]