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
21QT_BEGIN_NAMESPACE
22
23// Packaging system time_t functions
24namespace 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.
31Q_CORE_EXPORT int getCurrentStandardUtcOffset();
32Q_CORE_EXPORT int getUtcOffset(qint64 atMSecsSinceEpoch);
33#endif // QT_BOOTSTRAPPED
34
35// Support for QDateTime
36QDateTimePrivate::ZoneState utcToLocal(qint64 utcMillis);
37QString localTimeAbbbreviationAt(qint64 local, QDateTimePrivate::DaylightStatus dst);
38QDateTimePrivate::ZoneState mapLocalTime(qint64 local, QDateTimePrivate::DaylightStatus dst);
39
40struct SystemMillisRange { qint64 min, max; bool minClip, maxClip; };
41SystemMillisRange computeSystemMillisRange();
42}
43
44QT_END_NAMESPACE
45
46#endif // QLOCALTIME_P_H
47

source code of qtbase/src/corelib/time/qlocaltime_p.h