https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111163
--- Comment #2 from Paul Dreik <gcc at pauldreik dot se> --- The fmt lib had the same problem. I wrote a safe duration cast which eventually morphed into this: https://github.com/fmtlib/fmt/blob/9b74160817f2bc63288d2111e823a35dd3dbf234/include/fmt/chrono.h#L57-L68