https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114240
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
So this would fix it:
--- a/libstdc++-v3/include/bits/chrono_io.h
+++ b/libstdc++-v3/include/bits/chrono_io.h
@@ -2826,7 +2826,9 @@ namespace __detail
__offset = &__off;
using __format::_ChronoParts;
auto __need = _ChronoParts::_Year | _ChronoParts::_Month
- | _ChronoParts::_Day | _ChronoParts::_TimeOfDay;
+ | _ChronoParts::_Day;
+ if constexpr (ratio_less_v<typename _Duration::period, days::period>)
+ __need |= _ChronoParts::_TimeOfDay;
__detail::_Parser_t<_Duration> __p(__need);
if (__p(__is, __fmt, __abbrev, __offset))
{
A similar fix is needed for the from_stream overload for local_time, but
utc_time, gps_time and tai_time will be fixed by changing the sys_time
overload.