chrono-tz
chrono-tz copied to clipboard
GMTPlus* type error
When I use this code to process raw time string
match chrono::naive::NaiveDateTime::parse_from_str(&raw_timestring.trim(),&format{
Err(e)=>(),
Ok(t)=>created_time=Some(GMTPlus1.from_local_datetime(&t).unwrap().with_timezone(&Utc))
}
I found that the GMTPlus1.from_local_datetime(&t).unwrap() is returning timezone -01.
So am I misunderstanding doc or there's something wrong with your code?
For any future person baffled by this, the comment in the source data explains: https://github.com/eggert/tz/blob/ab21ad9710b88f28995b7ed47c6efda47ffb1be5/etcetera#L37-L43
In other words, it sounds like they're all flipped in sign from what you'd expect for POSIX compatibility.