mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 19:10:11 +08:00
when parsing a local_time, parse up to 9 digits worth (nanoseconds) of fractional seconds
This commit is contained in:
@@ -733,7 +733,13 @@ parse_local_time(location<Container>& loc)
|
|||||||
case 0: break;
|
case 0: break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
if(sf.size() >= 6)
|
if(sf.size() >= 9)
|
||||||
|
{
|
||||||
|
time.millisecond = from_string<std::uint16_t>(sf.substr(0, 3), 0u);
|
||||||
|
time.microsecond = from_string<std::uint16_t>(sf.substr(3, 3), 0u);
|
||||||
|
time.nanosecond = from_string<std::uint16_t>(sf.substr(6, 3), 0u);
|
||||||
|
}
|
||||||
|
else if(sf.size() >= 6)
|
||||||
{
|
{
|
||||||
time.millisecond = from_string<std::uint16_t>(sf.substr(0, 3), 0u);
|
time.millisecond = from_string<std::uint16_t>(sf.substr(0, 3), 0u);
|
||||||
time.microsecond = from_string<std::uint16_t>(sf.substr(3, 3), 0u);
|
time.microsecond = from_string<std::uint16_t>(sf.substr(3, 3), 0u);
|
||||||
|
Reference in New Issue
Block a user