This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yurzo
Recipients HassanAbouelela, belopolsky, p-ganssle, steven.daprano, yurzo
Date 2020-10-14.15:14:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602688477.72.0.304564614684.issue41904@roundup.psfhosted.org>
In-reply-to
Content
It took me a while to collect my thoughts but here you go.

Advanced users don't have a problem. They'll trade in date or datetime objects explicitly. The "proof" is I could not find any github repo with more than one start that'll call datetime.today().

The less advanced users are sometime doing datetime.today and then all kinds of weird things.

HassanAbouelela has a good point: datetime.today() is a straight forward way to get today in a datetime object.


On the topic of:

> "How long is it until Christmas?"

# Current
In [7]: datetime.datetime.today() - datetime.datetime.now()
Out[7]: datetime.timedelta(days=-1, seconds=86399, microseconds=999991)

# Hassan's
In [16]: datetime.datetime(2020, 12, 25) - datetime.datetime(datetime.datetime.today().year, datetime.datetime.today().month, datetime.datetime.today().day)
Out[16]: datetime.timedelta(days=72)


Optimizing for the less advanced user, I believe Hassan's proposal yields the more intuitive result.
History
Date User Action Args
2020-10-14 15:14:37yurzosetrecipients: + yurzo, belopolsky, steven.daprano, p-ganssle, HassanAbouelela
2020-10-14 15:14:37yurzosetmessageid: <1602688477.72.0.304564614684.issue41904@roundup.psfhosted.org>
2020-10-14 15:14:37yurzolinkissue41904 messages
2020-10-14 15:14:37yurzocreate