nyx-space/hifitime

Epoch formatting result is wrong

yizhepku opened this issue · 1 comments

fn main() {
    println!("{}", Epoch::from_str("1700-01-01T00:00:00 TAI").unwrap());
    // prints 1799-12-32T00:00:00 UTC

    println!("{}", Epoch::from_str("1799-01-01T00:00:00 TAI").unwrap());
    // prints 1898-12-31T00:00:00 UTC
}

The bug seems to appear (mostly) for year < 1800.