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 belopolsky
Recipients belopolsky, facundobatista, r.david.murray
Date 2014-07-24.15:52:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1406217142.86.0.352186401624.issue22058@psf.upfronthosting.co.za>
In-reply-to
Content
+1

There is currently no obvious way to convert either date or datetime instance to date.

The best solution I can think of is date(*x.timetuple()[:3]):

>>> d = date.today()
>>> t = datetime.now()
>>> date(*d.timetuple()[:3])
datetime.date(2014, 7, 24)
>>> date(*t.timetuple()[:3])
datetime.date(2014, 7, 24)

Certainly date(x) wins hands down over this atrocity.
History
Date User Action Args
2014-07-24 15:52:22belopolskysetrecipients: + belopolsky, facundobatista, r.david.murray
2014-07-24 15:52:22belopolskysetmessageid: <1406217142.86.0.352186401624.issue22058@psf.upfronthosting.co.za>
2014-07-24 15:52:22belopolskylinkissue22058 messages
2014-07-24 15:52:22belopolskycreate