Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
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
- Not sure about QTime
- QDateTime should have conversions from/to zoned_time, and also possibly system_clock / utc_clock as well; and convenience constructors and getters from combinations of std::chrono::year_month_day + time zone, etc.
- 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 Add a QTimeZone back-end based on C++20 std::chrono::tzdb
- Open