Message223853
+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. |
|
Date |
User |
Action |
Args |
2014-07-24 15:52:22 | belopolsky | set | recipients:
+ belopolsky, facundobatista, r.david.murray |
2014-07-24 15:52:22 | belopolsky | set | messageid: <1406217142.86.0.352186401624.issue22058@psf.upfronthosting.co.za> |
2014-07-24 15:52:22 | belopolsky | link | issue22058 messages |
2014-07-24 15:52:22 | belopolsky | create | |
|