3#if __has_include(<QtEnvironmentVariables>)
4#include <QtEnvironmentVariables>
22 QDateTime loc = QDateTime::currentDateTime();
23 QDateTime utc = loc.toUTC();
24#if QT_VERSION < QT_VERSION_CHECK(6,5,0)
25 loc = QDateTime(loc.date(), loc.time(), Qt::UTC);
27 loc = QDateTime(loc.date(), loc.time(), QTimeZone(QTimeZone::UTC));
29 return utc.secsTo(loc);
38 QString zone_id(
"UNDEF");
42 QString tz = qEnvironmentVariable(
"TZ");
46 QDateTime dt = QDateTime::currentDateTime();
47 tz = dt.timeZone().id();
53 if (zone_id.startsWith(
"\"") || zone_id.startsWith(
"'"))
55 if (zone_id.endsWith(
"\"") || zone_id.endsWith(
"'"))
57 if (zone_id.startsWith(
":"))
61 if (zone_id.startsWith(
"posix/"))
int calc_utc_offset(void)
QString getTimeZoneID(void)
Returns the zoneinfo time zone ID or as much time zone information as possible.
bool checkTimeZone(void)
Verifies the time zone settings on this system agree with those on the master backend.