mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-04 13:14:26 +02:00
Fix bug in sys_time and local_time from_stream
* to handle microfortnights
This commit is contained in:
4
date.h
4
date.h
@@ -6562,7 +6562,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
if (!fds.ymd.ok() || !fds.tod.in_conventional_range())
|
if (!fds.ymd.ok() || !fds.tod.in_conventional_range())
|
||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
tp = sys_days(fds.ymd) + duration_cast<Duration>(fds.tod.to_duration() - *offptr);
|
tp = round<Duration>(sys_days(fds.ymd) + fds.tod.to_duration() - *offptr);
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6580,7 +6580,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
if (!fds.ymd.ok() || !fds.tod.in_conventional_range())
|
if (!fds.ymd.ok() || !fds.tod.in_conventional_range())
|
||||||
is.setstate(ios::failbit);
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
tp = local_days(fds.ymd) + duration_cast<Duration>(fds.tod.to_duration());
|
tp = round<Duration>(local_days(fds.ymd) + fds.tod.to_duration());
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user