Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DateTime::<Utc>::from_timestamp #1279

Merged
merged 1 commit into from
Sep 11, 2023

Commits on Sep 10, 2023

  1. Add DateTime::<Utc>::from_timestamp

    This commit adds the new constructor `from_timestamp` 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 preferring fallible functions. It avoids however the `_opt` suffix as there is no panicking variant. See [this issue](chronotope#815) for discussion about error handling and panics.
    
    Closes chronotope#832
    demurgos committed Sep 10, 2023
    Configuration menu
    Copy the full SHA
    449d907 View commit details
    Browse the repository at this point in the history