Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
DateTime::<Utc>::from_timestamp_opt
This commit adds the new constructor `from_timestamp_opt` to build a `DateTime<Utc>` from a UNIX timestamp. Figuring out how to convert a timestamp into a `DateTime<Utc>` was a common issue: - chronotope#88 - chronotope#200 - chronotope#832 This commit should make `DateTime<Utc>` creation more discoverable and intuitive. This commit respects the current convention of using the `_opt` suffix for fallible functions. As panicking variants on invalid input are deprecated, no panicking variant is provided. See [this issue](chronotope#815) for discussion about error handling and panics. Closes chronotope#832
- Loading branch information