Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
-
5
-
Foundation PM Staging
Description
C++20 added calendaring support to C++. Qt classes should offer integrations for them.
(At the time of this writing, calendaring is not widely implemented, but one could experiment against HH's library on GitHub.)
Things that come into mind:
- ✓ QDate should have conversion from/to std::chrono::year_month_day done
- QTime could support conversion from/to durations (which would take care of std::chrono::hh_mm_ss since it is interconvertible with them).
- ✓ QDateTime should have conversions from/to zoned_time, and also possibly system_clock / utc_clock as well done;
and convenience constructors and getters from combinations of std::chrono::year_month_day + time zone, etc.(see 2023/Nov/23 comment).QTimeZone conversion from/to std::chrono::time_zone (may be not possible in general but only for named zones)→QTBUG-68812
The goal would be to avoid reimplementing date time math in Qt (which seems to be a fairly popular request) and just let people use the std or HH's facilities, but have then easy-to-use conversions if they want to locale-format a date, store it using QtSQL, etc.
(Of course we might even go all in and provide formatting etc. for std::chrono classes, without conversions)
Attachments
Issue Links
- relates to
-
QTBUG-68812 A new back-end for QTimeZone based on C++20 std::chrono::tzdb
- Closed