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 Date type #6

Open
rsyring opened this issue Apr 7, 2018 · 3 comments
Open

Add Date type #6

rsyring opened this issue Apr 7, 2018 · 3 comments

Comments

@rsyring
Copy link

rsyring commented Apr 7, 2018

Could you add a date type, for when we want dates without times?

@ddaws
Copy link
Collaborator

ddaws commented Sep 9, 2024

Is this really useful? You can specify a custom date format and only parse the date components, then only use the date component of the date time

@rsyring
Copy link
Author

rsyring commented Sep 10, 2024

Is this really useful? Y ou can specify a custom date format and only parse the date components, then only use the date component of the date time

It's a small benefit. Mostly semantic I guess. But date != datetime, I like to be precise. :)

@mdoggydog
Copy link

More specifically: datetime.date is a different type from datetime.datetime, and they are not interchangeable (e.g., some_date < some_datetime does not work).

If you have code that uses dates, and you want a user option that provides a date, with click.DateTime you need to do shenanigans somewhere to cast the datetime values into date, and the typing of your command methods is inaccurate (because the method signature needs to say datetime when what it really should get is date), etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants