diff --git a/include/date/date.h b/include/date/date.h index cbcbf32..0c3d4c2 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -8046,12 +8046,13 @@ from_stream(std::basic_istream& is, const CharT* fmt, { using Duration = std::chrono::duration; using CT = typename std::common_type::type; + using detail::round_i; fields fds{}; date::from_stream(is, fmt, fds, abbrev, offset); if (!fds.has_tod) is.setstate(std::ios::failbit); if (!is.fail()) - d = std::chrono::duration_cast(fds.tod.to_duration()); + d = round_i(fds.tod.to_duration()); return is; }