summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qlocaltime_p.h
blob: 027b1bc05bc35d587cad9ad9e24f6ed87229f3a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QLOCALTIME_P_H
#define QLOCALTIME_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an implementation
// detail.  This header file may change from version to version without notice,
// or even be removed.
//
// We mean it.
//

#include <QtCore/private/qglobal_p.h>
#include <QtCore/private/qdatetime_p.h>

QT_BEGIN_NAMESPACE

// Packaging system time_t functions
namespace QLocalTime {
#ifndef QT_BOOTSTRAPPED
// Support for V4's Date implelenentation.
// Each returns offset from UTC in seconds (or 0 if unknown).
// V4 shall need to multiply by 1000.
// Offset is -ve East of Greenwich, +ve west of Greenwich.
// Add it to UTC seconds since epoch to get local seconds since nominal local epoch.
Q_CORE_EXPORT int getCurrentStandardUtcOffset();
Q_CORE_EXPORT int getUtcOffset(qint64 atMSecsSinceEpoch);
#endif // QT_BOOTSTRAPPED

// Support for QDateTime
QDateTimePrivate::ZoneState utcToLocal(qint64 utcMillis);
QString localTimeAbbbreviationAt(qint64 local, QDateTimePrivate::DaylightStatus dst);
QDateTimePrivate::ZoneState mapLocalTime(qint64 local, QDateTimePrivate::DaylightStatus dst);

struct SystemMillisRange { qint64 min, max; bool minClip, maxClip; };
SystemMillisRange computeSystemMillisRange();
}

QT_END_NAMESPACE

#endif // QLOCALTIME_P_H