QTimeZone::OffsetData Struct
struct QTimeZone::OffsetData详细说明
特定时刻的时区偏移量数据。
该数据提供特定时刻应使用的时区偏移量及缩写。当函数返回此类型时,可能会使用无效的日期时间来表示其所响应的查询无有效结果,因此在使用结果前请检查 `atUtc.isValid() `。
- OffsetData::atUtc 时区偏移数据在协调世界时(UTC)下的时间戳。
- OffsetData::offsetFromUtc 该时间点相对于 UTC 的总偏移量。
- OffsetData::standardTimeOffset 总偏移量中的标准时间偏移量部分。
- OffsetData::daylightTimeOffset 总偏移量中的夏令时偏移量部分。
- OffsetData::abbreviation 该时间点生效的缩写。
例如,对于时区“Europe/Berlin”,标准时间和夏令时下的 OffsetData 可能为:
- atUtc =QDateTime(QDate(2013, 1, 1),QTime(0, 0),QTimeZone::UTC)
- offsetFromUtc = 3600
- standardTimeOffset = 3600
- daylightTimeOffset = 0
- 缩写 = "CET"
- atUtc =QDateTime(QDate(2013, 6, 1),QTime(0, 0),QTimeZone::UTC)
- offsetFromUtc = 7200
- standardTimeOffset = 3600
- daylightTimeOffset = 3600
- 缩写 = "CEST"
此类型仅在启用timezone 功能时可用。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.