mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 08:31:03 +08:00
Fix bug in sys_time and local_time from_stream
* to handle microfortnights
This commit is contained in:
parent
922abf1299
commit
82de27d339
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())
|
||||
is.setstate(ios::failbit);
|
||||
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;
|
||||
}
|
||||
|
||||
@ -6580,7 +6580,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||
if (!fds.ymd.ok() || !fds.tod.in_conventional_range())
|
||||
is.setstate(ios::failbit);
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user