| 1 | // Copyright (C) 2022 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QLOCALTIME_P_H |
| 5 | #define QLOCALTIME_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an implementation |
| 12 | // detail. This header file may change from version to version without notice, |
| 13 | // or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtCore/private/qglobal_p.h> |
| 19 | #include <QtCore/private/qdatetime_p.h> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | // Packaging system time_t functions |
| 24 | namespace QLocalTime { |
| 25 | #ifndef QT_BOOTSTRAPPED |
| 26 | // Support for V4's Date implelenentation. |
| 27 | // Each returns offset from UTC in seconds (or 0 if unknown). |
| 28 | // V4 shall need to multiply by 1000. |
| 29 | // Offset is -ve East of Greenwich, +ve west of Greenwich. |
| 30 | // Add it to UTC seconds since epoch to get local seconds since nominal local epoch. |
| 31 | Q_CORE_EXPORT int getCurrentStandardUtcOffset(); |
| 32 | Q_CORE_EXPORT int getUtcOffset(qint64 atMSecsSinceEpoch); |
| 33 | #endif // QT_BOOTSTRAPPED |
| 34 | |
| 35 | // Support for QDateTime |
| 36 | QDateTimePrivate::ZoneState utcToLocal(qint64 utcMillis); |
| 37 | QString localTimeAbbbreviationAt(qint64 local, QDateTimePrivate::TransitionOptions resolve); |
| 38 | QDateTimePrivate::ZoneState mapLocalTime(qint64 local, QDateTimePrivate::TransitionOptions resolve); |
| 39 | |
| 40 | struct SystemMillisRange { qint64 min, max; bool minClip, maxClip; }; |
| 41 | SystemMillisRange computeSystemMillisRange(); |
| 42 | } |
| 43 | |
| 44 | QT_END_NAMESPACE |
| 45 | |
| 46 | #endif // QLOCALTIME_P_H |
| 47 | |