diff --git a/toml/parser.hpp b/toml/parser.hpp index 7cf644a..dc8422d 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -792,13 +792,13 @@ parse_offset_datetime(location& loc) const auto str = ofs.unwrap().str(); if(str.front() == '+') { - offset.hour = static_cast(from_string(str.substr(1,2), 0)); - offset.minute = static_cast(from_string(str.substr(4,2), 0)); + offset = time_offset(from_string(str.substr(1,2), 0), + from_string(str.substr(4,2), 0)); } else { - offset.hour = -static_cast(from_string(str.substr(1,2), 0)); - offset.minute = -static_cast(from_string(str.substr(4,2), 0)); + offset = time_offset(-from_string(str.substr(1,2), 0), + -from_string(str.substr(4,2), 0)); } } else if(*inner_loc.iter() != 'Z' && *inner_loc.iter() != 'z')