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 p-ganssle
Recipients belopolsky, p-ganssle, tim.peters
Date 2018-01-09.15:46:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1515512810.75.0.467229070634.issue32522@psf.upfronthosting.co.za>
In-reply-to
Content
One thing I think that is fairly common is the desire to get the current datetime only up to a current precision, so you see a lot of things in, say, `dateutil` like this:

    dt = datetime.now().replace(hours=0, minutes=0, seconds=0, microseconds=0)

Or:

    dt = datetime.now().replace(microseconds=0)

I think it would make sense to add a `precision` keyword argument, similar to the `timespec` argument to isoformat (https://docs.python.org/3/library/datetime.html#datetime.datetime.isoformat), then you could just do:

dt = datetime.now(precision='day')

And get the current date as a datetime.
History
Date User Action Args
2018-01-09 15:46:50p-gansslesetrecipients: + p-ganssle, tim.peters, belopolsky
2018-01-09 15:46:50p-gansslesetmessageid: <1515512810.75.0.467229070634.issue32522@psf.upfronthosting.co.za>
2018-01-09 15:46:50p-gansslelinkissue32522 messages
2018-01-09 15:46:50p-gansslecreate