8# include "qtimezoneprivate_p.h"
11#include <QtCore/qdatastream.h>
12#include <QtCore/qdatetime.h>
21static_assert(!std::is_constructible_v<QTimeZone, Qt::TimeSpec>);
22using namespace Qt::StringLiterals;
24#if QT_CONFIG(timezone)
26static QTimeZonePrivate *newBackendTimeZone()
28#if QT_CONFIG(timezone_tzdb)
29 return new QChronoTimeZonePrivate();
30#elif defined(Q_OS_DARWIN)
31 return new QMacTimeZonePrivate();
32#elif defined(Q_OS_ANDROID)
33 return new QAndroidTimeZonePrivate();
34#elif defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) && !defined(Q_OS_WASM) && !defined(Q_OS_HARMONY)
35 return new QTzTimeZonePrivate();
37 return new QIcuTimeZonePrivate();
38#elif defined(Q_OS_WIN)
39 return new QWinTimeZonePrivate();
41 return new QUtcTimeZonePrivate();
46static QTimeZonePrivate *newBackendTimeZone(
const QByteArray &ianaId)
48 Q_ASSERT(!ianaId.isEmpty());
49#if QT_CONFIG(timezone_tzdb)
50 return new QChronoTimeZonePrivate(ianaId);
51#elif defined(Q_OS_DARWIN)
52 return new QMacTimeZonePrivate(ianaId);
53#elif defined(Q_OS_ANDROID)
54 return new QAndroidTimeZonePrivate(ianaId);
55#elif defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) && !defined(Q_OS_WASM) && !defined(Q_OS_HARMONY)
56 return new QTzTimeZonePrivate(ianaId);
58 return new QIcuTimeZonePrivate(ianaId);
59#elif defined(Q_OS_WIN)
60 return new QWinTimeZonePrivate(ianaId);
62 return new QUtcTimeZonePrivate(ianaId);
66class QTimeZoneSingleton
69 QTimeZoneSingleton() : backend(newBackendTimeZone()) {}
76 QExplicitlySharedDataPointer<QTimeZonePrivate> backend;
80Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
279
280
281
282
283
284
285
286
287
288
289
290
291
293#if QT_CONFIG(timezone)
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
379
380
381
382
383
384
387QTimeZone::Data::Data()
noexcept : d(
nullptr)
390 static_assert(
int(Qt::TimeZone) == 3);
393QTimeZone::Data::Data(
const Data &other)
noexcept
395#if QT_CONFIG(timezone)
396 if (!other.isShort() && other.d)
402QTimeZone::Data::Data(QTimeZonePrivate *dptr)
noexcept
405#if QT_CONFIG(timezone)
411QTimeZone::Data::~Data()
413#if QT_CONFIG(timezone)
414 if (!isShort() && d && !d->ref.deref())
420QTimeZone::Data &QTimeZone::Data::operator=(
const Data &other)
noexcept
422#if QT_CONFIG(timezone)
423 if (!other.isShort())
424 return *
this = other.d;
425 if (!isShort() && d && !d->ref.deref())
433
434
436QTimeZone::QTimeZone()
noexcept
439 static_assert(
sizeof(ShortData) <=
sizeof(Data::d));
441 static_assert(qintptr(1) << (
sizeof(
void *) * 8 - 2) >= MaxUtcOffsetSecs);
444#if QT_CONFIG(timezone)
445QTimeZone::Data &QTimeZone::Data::operator=(QTimeZonePrivate *dptr)
noexcept
450 if (d && !d->ref.deref())
456 Q_ASSERT(!isShort());
461
462
463
464
465
466
467
468
469
470
471
473QTimeZone::QTimeZone(
const QByteArray &ianaId)
477 d =
new QUtcTimeZonePrivate(ianaId);
480 if (ianaId.isEmpty()) {
481 d = newBackendTimeZone();
483 d = newBackendTimeZone(ianaId);
486 QByteArrayView name = QTimeZonePrivate::aliasToIana(ianaId);
488 if (name.isEmpty() || name == ianaId)
489 name = global_tz->backend->availableAlias(ianaId);
490 if (!name.isEmpty() && name != ianaId)
491 d = newBackendTimeZone(name.toByteArray());
498 qint64 offset = QUtcTimeZonePrivate::offsetFromUtcString(ianaId);
499 if (offset != QTimeZonePrivate::invalidSeconds()) {
501 qint32 seconds = qint32(offset);
502 Q_ASSERT(qint64(seconds) == offset);
504 d =
new QUtcTimeZonePrivate(seconds);
510
511
512
513
514
515
516
517
518
519
520
521
523QTimeZone::QTimeZone(
int offsetSeconds)
524 : d((offsetSeconds >= MinUtcOffsetSecs && offsetSeconds <= MaxUtcOffsetSecs)
525 ?
new QUtcTimeZonePrivate(offsetSeconds) :
nullptr)
531static QTimeZonePrivate *newCustomZone(
const QByteArray &zoneId,
int offsetSeconds,
532 const QString &name,
const QString &abbreviation,
533 QLocale::Territory territory,
const QString &comment)
535 if (offsetSeconds < QTimeZone::MinUtcOffsetSecs || offsetSeconds > QTimeZone::MaxUtcOffsetSecs)
537 if (QUtcTimeZonePrivate().isTimeZoneIdAvailable(zoneId)
538 || global_tz->backend->isTimeZoneIdAvailable(zoneId)) {
541 return new QUtcTimeZonePrivate(zoneId, offsetSeconds, name, abbreviation, territory, comment);
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
568QTimeZone::QTimeZone(
const QByteArray &zoneId,
int offsetSeconds,
const QString &name,
569 const QString &abbreviation, QLocale::Territory territory,
const QString &comment)
570 : d(newCustomZone(zoneId, offsetSeconds, name, abbreviation, territory, comment))
575
576
577
578
579
580
582QTimeZone::QTimeZone(QTimeZonePrivate &dd)
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
610QTimeZone QTimeZone::asBackendZone()
const
612 switch (timeSpec()) {
616 return systemTimeZone();
619 case Qt::OffsetFromUTC:
620 return QTimeZone(*
new QUtcTimeZonePrivate(
int(d.s.offset)));
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
647
648
649
650
651
652
653
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
678
679
680
681
682
683
684
685
686
687
688
689
692
693
694
695
696
697
698
699
702
703
704
705
706
709
710
711
712
713
714
715
716
717
718
721
722
724QTimeZone::QTimeZone(
const QTimeZone &other)
noexcept
730
731
732
733
736
737
739QTimeZone::~QTimeZone()
744
745
746
749
750
752QTimeZone &QTimeZone::operator=(
const QTimeZone &other)
759
760
761
762
763
766
767
768
769
770
771
772
773
774
777
778
779
780
781
782
783
784
785
790 return rhs.d.isShort() && lhs.d.s == rhs.d.s;
792 if (!rhs.d.isShort()) {
793 if (lhs.d.d == rhs.d.d)
795#if QT_CONFIG(timezone)
796 return lhs.d.d && rhs.d.d && *lhs.d.d == *rhs.d.d;
804
805
807bool QTimeZone::isValid()
const
809#if QT_CONFIG(timezone)
811 return d.d && d->isValid();
816#if QT_CONFIG(timezone)
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
848QByteArray QTimeZone::id()
const
851 switch (d.s.spec()) {
853 return QTimeZonePrivate::utcQByteArray();
855 return systemTimeZoneId();
856 case Qt::OffsetFromUTC:
857 return QUtcTimeZonePrivate(d.s.offset).id();
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884bool QTimeZone::hasAlternativeName(QByteArrayView alias)
const
886 const QByteArray me = id();
889 QByteArrayView mine = QTimeZonePrivate::aliasToIana(me);
893 else if (alias == mine)
895 QByteArrayView its = QTimeZonePrivate::aliasToIana(alias);
898 return !its.isEmpty() && its == mine;
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916QLocale::Territory QTimeZone::territory()
const
919 if (d.s.spec() == Qt::LocalTime)
920 return systemTimeZone().territory();
921 }
else if (isValid()) {
922 return d->territory();
924 return QLocale::AnyTerritory;
927#if QT_DEPRECATED_SINCE(6
, 6
)
929
930
931
932
933
934
936QLocale::Country QTimeZone::country()
const
943
944
945
946
947
948
949
950
952QString QTimeZone::comment()
const
956 }
else if (isValid()) {
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
985QString QTimeZone::displayName(
const QDateTime &atDateTime, NameType nameType,
986 const QLocale &locale)
const
989 switch (d.s.spec()) {
991 return systemTimeZone().displayName(atDateTime, nameType, locale);
993 case Qt::OffsetFromUTC:
994 return QUtcTimeZonePrivate(d.s.offset).displayName(
995 atDateTime.toMSecsSinceEpoch(), nameType, locale);
1000 }
else if (isValid()) {
1001 return d->displayName(atDateTime.toMSecsSinceEpoch(), nameType, locale);
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1019QString QTimeZone::displayName(TimeType timeType, NameType nameType,
1020 const QLocale &locale)
const
1023 switch (d.s.spec()) {
1025 return systemTimeZone().displayName(timeType, nameType, locale);
1027 case Qt::OffsetFromUTC:
1028 return QUtcTimeZonePrivate(d.s.offset).displayName(timeType, nameType, locale);
1033 }
else if (isValid()) {
1034 return d->displayName(timeType, nameType, locale);
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1055QString QTimeZone::abbreviation(
const QDateTime &atDateTime)
const
1058 switch (d.s.spec()) {
1060 return systemTimeZone().abbreviation(atDateTime);
1062 case Qt::OffsetFromUTC:
1063 return QUtcTimeZonePrivate(d.s.offset).abbreviation(atDateTime.toMSecsSinceEpoch());
1068 }
else if (isValid()) {
1069 return d->abbreviation(atDateTime.toMSecsSinceEpoch());
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1091int QTimeZone::offsetFromUtc(
const QDateTime &atDateTime)
const
1094 switch (d.s.spec()) {
1096 return systemTimeZone().offsetFromUtc(atDateTime);
1098 case Qt::OffsetFromUTC:
1104 }
else if (isValid()) {
1105 const int offset = d->offsetFromUtc(atDateTime.toMSecsSinceEpoch());
1106 if (offset != QTimeZonePrivate::invalidSeconds())
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1126int QTimeZone::standardTimeOffset(
const QDateTime &atDateTime)
const
1129 switch (d.s.spec()) {
1131 return systemTimeZone().standardTimeOffset(atDateTime);
1133 case Qt::OffsetFromUTC:
1139 }
else if (isValid()) {
1140 const int offset = d->standardTimeOffset(atDateTime.toMSecsSinceEpoch());
1141 if (offset != QTimeZonePrivate::invalidSeconds())
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1161int QTimeZone::daylightTimeOffset(
const QDateTime &atDateTime)
const
1164 switch (d.s.spec()) {
1166 return systemTimeZone().daylightTimeOffset(atDateTime);
1168 case Qt::OffsetFromUTC:
1174 }
else if (hasDaylightTime()) {
1175 const int offset = d->daylightTimeOffset(atDateTime.toMSecsSinceEpoch());
1176 if (offset != QTimeZonePrivate::invalidSeconds())
1183
1184
1185
1186
1187
1188
1190bool QTimeZone::hasDaylightTime()
const
1193 switch (d.s.spec()) {
1195 return systemTimeZone().hasDaylightTime();
1197 case Qt::OffsetFromUTC:
1203 }
else if (isValid()) {
1204 return d->hasDaylightTime();
1210
1211
1212
1213
1214
1215
1217bool QTimeZone::isDaylightTime(
const QDateTime &atDateTime)
const
1220 switch (d.s.spec()) {
1222 return systemTimeZone().isDaylightTime(atDateTime);
1224 case Qt::OffsetFromUTC:
1230 }
else if (hasDaylightTime()) {
1231 return d->isDaylightTime(atDateTime.toMSecsSinceEpoch());
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1250QTimeZone::OffsetData QTimeZone::offsetData(
const QDateTime &forDateTime)
const
1253 switch (d.s.spec()) {
1255 return systemTimeZone().offsetData(forDateTime);
1257 case Qt::OffsetFromUTC:
1258 return { abbreviation(forDateTime), forDateTime,
int(d.s.offset),
int(d.s.offset), 0 };
1265 return QTimeZonePrivate::toOffsetData(d->data(forDateTime.toMSecsSinceEpoch()));
1267 return QTimeZonePrivate::invalidOffsetData();
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1286bool QTimeZone::hasTransitions()
const
1289 switch (d.s.spec()) {
1291 return systemTimeZone().hasTransitions();
1293 case Qt::OffsetFromUTC:
1299 }
else if (isValid()) {
1300 return d->hasTransitions();
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1320QTimeZone::OffsetData QTimeZone::nextTransition(
const QDateTime &afterDateTime)
const
1323 switch (d.s.spec()) {
1325 return systemTimeZone().nextTransition(afterDateTime);
1327 case Qt::OffsetFromUTC:
1333 }
else if (isValid() && hasTransitions()) {
1334 return QTimeZonePrivate::toOffsetData(d->nextTransition(afterDateTime.toMSecsSinceEpoch()));
1337 return QTimeZonePrivate::invalidOffsetData();
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1355QTimeZone::OffsetData QTimeZone::previousTransition(
const QDateTime &beforeDateTime)
const
1358 switch (d.s.spec()) {
1360 return systemTimeZone().previousTransition(beforeDateTime);
1362 case Qt::OffsetFromUTC:
1368 }
else if (isValid() && hasTransitions()) {
1369 return QTimeZonePrivate::toOffsetData(
1370 d->previousTransition(beforeDateTime.toMSecsSinceEpoch()));
1373 return QTimeZonePrivate::invalidOffsetData();
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1388QTimeZone::OffsetDataList QTimeZone::transitions(
const QDateTime &fromDateTime,
1389 const QDateTime &toDateTime)
const
1391 OffsetDataList list;
1393 switch (d.s.spec()) {
1395 return systemTimeZone().transitions(fromDateTime, toDateTime);
1397 case Qt::OffsetFromUTC:
1403 }
else if (isValid() && hasTransitions()) {
1404 const QTimeZonePrivate::DataList plist = d->transitions(fromDateTime.toMSecsSinceEpoch(),
1405 toDateTime.toMSecsSinceEpoch());
1406 list.reserve(plist.size());
1407 for (
const QTimeZonePrivate::Data &pdata : plist)
1408 list.append(QTimeZonePrivate::toOffsetData(pdata));
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1440QByteArray QTimeZone::systemTimeZoneId()
1442 QByteArray sys = global_tz->backend->systemTimeZoneId();
1446 return global_tz->backend->id();
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467QTimeZone QTimeZone::systemTimeZone()
1470 const QByteArray sysId = global_tz->backend->systemTimeZoneId();
1471 const auto sys = sysId.isEmpty() ? QTimeZone(global_tz->backend) : QTimeZone(sysId);
1472 if (!sys.isValid()) {
1473 static bool neverWarned =
true;
1476 neverWarned =
false;
1477 qWarning(
"Unable to determine system time zone: "
1478 "please check your system configuration.");
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496QTimeZone QTimeZonePrivate::utcQTimeZone()
1498 return QTimeZone(*
new QUtcTimeZonePrivate());
1501Q_GLOBAL_STATIC(QTimeZone, utcTimeZone, QTimeZonePrivate::utcQTimeZone());
1503QTimeZone QTimeZone::utc()
1505 if (Q_UNLIKELY(utcTimeZone.isDestroyed()))
1506 return QTimeZonePrivate::utcQTimeZone();
1507 return *utcTimeZone;
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1522bool QTimeZone::isTimeZoneIdAvailable(QByteArrayView ianaId)
1524#if defined(Q_OS_UNIX) && !(QT_CONFIG(timezone_tzdb) || defined(Q_OS_DARWIN)
1525 || defined(Q_OS_ANDROID) || defined(Q_OS_VXWORKS))
1532 if (!QTimeZonePrivate::isValidId(ianaId))
1535 if (QUtcTimeZonePrivate().isTimeZoneIdAvailable(ianaId)
1536 || QUtcTimeZonePrivate::offsetFromUtcString(ianaId) != QTimeZonePrivate::invalidSeconds()
1537 || global_tz->backend->isTimeZoneIdAvailable(ianaId)) {
1540 if (
const auto name = QTimeZonePrivate::aliasToIana(ianaId); !name.isEmpty()) {
1541 return QUtcTimeZonePrivate().isTimeZoneIdAvailable(name)
1542 || global_tz->backend->isTimeZoneIdAvailable(name);
1545 QByteArrayView known = global_tz->backend->availableAlias(ianaId);
1546 return !known.isEmpty();
1549[[maybe_unused]]
static bool isUniqueSorted(
const QList<QByteArray> &seq)
1552 return std::adjacent_find(seq.cbegin(), seq.cend(),
1553 std::greater_equal<QByteArray>()) == seq.cend();
1556static QList<QByteArray> set_union(
const QList<QByteArray> &l1,
const QList<QByteArray> &l2)
1558 Q_ASSERT(isUniqueSorted(l1));
1559 Q_ASSERT(isUniqueSorted(l2));
1560 QList<QByteArray> result;
1561 result.reserve(l1.size() + l2.size());
1562 std::set_union(l1.begin(), l1.end(),
1563 l2.begin(), l2.end(),
1564 std::back_inserter(result));
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1593QList<QByteArray> QTimeZone::availableTimeZoneIds()
1597 return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(),
1598 global_tz->backend->availableTimeZoneIds());
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1615QList<QByteArray> QTimeZone::availableTimeZoneIds(QLocale::Territory territory)
1617 return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(territory),
1618 global_tz->backend->availableTimeZoneIds(territory));
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1634QList<QByteArray> QTimeZone::availableTimeZoneIds(
int offsetSeconds)
1636 return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(offsetSeconds),
1637 global_tz->backend->availableTimeZoneIds(offsetSeconds));
1641
1642
1643
1644
1645
1646
1648QByteArray QTimeZone::ianaIdToWindowsId(
const QByteArray &ianaId)
1650 return QTimeZonePrivate::ianaIdToWindowsId(ianaId).toByteArray();
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1666QByteArray QTimeZone::windowsIdToDefaultIanaId(
const QByteArray &windowsId)
1668 return QTimeZonePrivate::windowsIdToDefaultIanaId(windowsId).toByteArray();
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1691QByteArray QTimeZone::windowsIdToDefaultIanaId(
const QByteArray &windowsId,
1692 QLocale::Territory territory)
1694 return QTimeZonePrivate::windowsIdToDefaultIanaId(windowsId, territory).toByteArray();
1698
1699
1700
1701
1702
1703
1704
1705
1707QList<QByteArray> QTimeZone::windowsIdToIanaIds(
const QByteArray &windowsId)
1709 return QTimeZonePrivate::windowsIdToIanaIds(windowsId);
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1728QList<QByteArray> QTimeZone::windowsIdToIanaIds(
const QByteArray &windowsId,
1729 QLocale::Territory territory)
1731 return QTimeZonePrivate::windowsIdToIanaIds(windowsId, territory);
1735
1736
1737
1738
1739
1740
1741
1742
1743
1746template <
typename Stream,
typename Wrap>
1747void QTimeZone::Data::serialize(Stream &out,
const Wrap &wrap)
const
1752 out << wrap(
"QTimeZone::UTC");
1755 out << wrap(
"QTimeZone::LocalTime");
1757 case Qt::OffsetFromUTC:
1758 out << wrap(
"AheadOfUtcBy") <<
int(s.offset);
1766#if QT_CONFIG(timezone)
1767 if constexpr (std::is_same<Stream, QDataStream>::value) {
1772 out << QString::fromUtf8(d ? QByteArrayView(d->id()) : QByteArrayView());
1777#ifndef QT_NO_DATASTREAM
1783 const auto toQString = [](
const char *text) {
1784 return QString(QLatin1StringView(text));
1787 tz.d.serialize(ds, toQString);
1798 if (ianaId == invalidId()) {
1800 }
else if (ianaId ==
"OffsetFromUtc"_L1) {
1803 QString abbreviation;
1806 ds >> ianaId >> utcOffset >> name >> abbreviation >> territory >> comment;
1807#if QT_CONFIG(timezone)
1811 tz = QTimeZone(ianaId.toUtf8());
1812 if (!tz.isValid() || tz.hasDaylightTime()
1813 || tz.offsetFromUtc(QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC)) != utcOffset) {
1815 tz = QTimeZone(ianaId.toUtf8(), utcOffset, name, abbreviation,
1816 QLocale::Territory(territory), comment);
1819 tz = QTimeZone::fromSecondsAheadOfUtc(utcOffset);
1821 }
else if (ianaId ==
"AheadOfUtcBy"_L1) {
1824 tz = QTimeZone::fromSecondsAheadOfUtc(utcOffset);
1825 }
else if (ianaId ==
"QTimeZone::UTC"_L1) {
1826 tz = QTimeZone(QTimeZone::UTC);
1827 }
else if (ianaId ==
"QTimeZone::LocalTime"_L1) {
1828 tz = QTimeZone(QTimeZone::LocalTime);
1829#if QT_CONFIG(timezone)
1831 tz = QTimeZone(ianaId.toUtf8());
1838#ifndef QT_NO_DEBUG_STREAM
1841 QDebugStateSaver saver(dbg);
1842 const auto asIs = [](
const char *text) {
return text; };
1844 dbg.nospace() <<
"QTimeZone(";
1845 tz.d.serialize(dbg, asIs);
1846 dbg.nospace() <<
')';
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
bool comparesEqual(const QFileInfo &lhs, const QFileInfo &rhs)
static QString invalidId()
QDataStream & operator<<(QDataStream &stream, const QImage &image)
[0]
QDataStream & operator>>(QDataStream &stream, QImage &image)