chrono
chrono copied to clipboard
Date and time library for Rust
In the documentation for `format::strftime` `%Z` is supposed to print the name of the local time zone (e.g. `CET`), but instead it prints `+1:00`, which should be displayed with `%:z`....
For some calculations it's useful to get the number of days in the current month. For example, I want to get the first and last day in a given month...
I currently need to use a custom serializer/deserializer to format my timestamps into f64 values for JSON because the builtin serializer/deserializer for serde can only do seconds accuracy. This seems...
On some systems we can only get the time in UTC (SGX), or we can get only the local time (it think this is WASI). Or we may fall back...
If I understand the docs correctly, `%:::z` corresponds to the timezone offset, *without* minutes. When formatting, this works correctly. However, when parsing it *does* expect minutes, and rejects inputs that...
To a serde format, the chrono types are indistinguishable from string types. This works for JSON, because it doesn't have a proper date type, but for TOML and other formats...
Hello! I was curious whether it's a bug, a design choice, or my incorrect usage of the framework and would definitely appreciate any help and guidance on this one! I'm...
Here's a reproducible example: ```rust use chrono; fn main() { println!("{:?}", chrono::NaiveDate::parse_from_str("2020-01-01 17", "%Y-%m-%d %H")); println!("{:?}", chrono::NaiveDate::parse_from_str("2020-01", "%Y-%m")); } ``` This outputs ```rust Ok(2020-01-01) Err(ParseError(NotEnough)) ``` My question is -...
Is there a way to do this with `chrono-tz`? ```rust ::from_str(value).or(Err(RangeError))? ``` Any ideas about converting it back to a string? (The above doesn't compile.) ... Hm, I'm not sure...
I don't think #1121 is the right approach. The fallibility here is with (a) parsing the format string, which might be invalid, and (b) whether the type we're formatting from...