Paul Dicker

Results 308 comments of Paul Dicker
trafficstars

### Better name Shall we try to pick a better name for `LocalResult`? If I had to give a description of its function: "The result of looking up a local...

> Methods on `DateTime` currently don't return a `LocalResult`, but consider any result that falls in a timezone transition as an error. This makes it cumbersome for users to handle...

> I'd like to get away from the `LocalResult` naming because, for the same reasons, `LocalResult` to me represents the `Ok` part of an actual `Result`, that is, it is...

> Maybe we should dig ourselves out of this first so we have a better sense of how things fit together? That should not need an awful lot of digging...

What would we need to change to propagate the error instead of unwrapping on [this line](https://github.com/chronotope/chrono/blob/v0.4.34/src/offset/local/mod.rs#L185) in `Local::offset_from_utc_datetime`? Three methods: - `TimeZone::offset_from_utc_datetime` - `Timezone::from_utc_datetime` - `DateTime::with_timezone` Those methods currently come...

How about `TzResolution` as a new name for `LocalResult`? Inspired by the `DateTimeResolution` name of a similar type in eos.

> Particularly in the context of datetimes what exactly "before" means when considering a gap. Is it one second before? One nanosecond before? As I see it the before and...

I am afraid that is pretty much it. ```rust let today = Local::now().date_naive(); let midnight = NaiveTime::MIN; let today_at_midnight = Local.from_local_datetime(today.and_time(midnight)).unwrap(); // or handle the result ```

I am hoping to have `DateTime::set_time` at some point. Then you can write `Local::now().set_time(NaiveTime::MIN).unwrap()`. That also takes care of one remaining panic case from #1047 that I don't have a...

As a mini-history, glossing over all details: before the release of rust 1.0 time-rs had the simple platform interfaces, and chrono was the date-time library. At some point time-rs was...