Skip to content

docs: Instant vs ZonedDateTime #239

@iloveitaly

Description

@iloveitaly

Love the library!

I feel like I'm missing something obvious:

start_of_day = Instant.now().to_tz("UTC").start_of_day()

This is the best way I've found to get the start of the current day. It looks like you can't do this via the Instant object and converting to a ZonedDateTime is the only way to get start_of_day helpers and friends.

However, there's no now() method on ZonedDateTime, which makes getting the current time cumbersome. It's also confusing to me why Instant doesn't have the ZonedDateTime helpers.

I'm happy to contribute changes to the docs to explain this. If someone could explain to me how it works first! Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionDiscussion is needed before proceedingdocumentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions