Message378621
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. |
|
Date |
User |
Action |
Args |
2020-10-14 15:14:37 | yurzo | set | recipients:
+ yurzo, belopolsky, steven.daprano, p-ganssle, HassanAbouelela |
2020-10-14 15:14:37 | yurzo | set | messageid: <1602688477.72.0.304564614684.issue41904@roundup.psfhosted.org> |
2020-10-14 15:14:37 | yurzo | link | issue41904 messages |
2020-10-14 15:14:37 | yurzo | create | |
|