Skip to content

Commit

Permalink
fix(datetime): Allow leap seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 23, 2023
1 parent 99d50bb commit 3e44692
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/toml_datetime/src/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ impl FromStr for Datetime {
if time.minute > 59 {
return Err(DatetimeParseError {});
}
if time.second > 59 {
// 00-58, 00-59, 00-60 based on leap second rules
if time.second > 60 {
return Err(DatetimeParseError {});
}
if time.nanosecond > 999_999_999 {
Expand Down

0 comments on commit 3e44692

Please sign in to comment.