消息 [162658]
Two objections have been raised to the proposed datetime.localtime() function:
1. It offers the third subtly different way to obtain current time in datetime module. The first two being provided by datetime.now() and datetime.today().
2. C library localtime function takes POSIX timestamp as an argument, so datetime.localtime() should follow suit.
I attach a prototype patch for a different approach: make datetime.astimezone() method supply local timezone information if no argument is given.
This patch also demonstrates that extracting all TZ information that platform may have knowledge of is not trivial. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2012-06-12 02:27:41 | belopolsky | 修改 | recipients:
+ belopolsky, tim.peters, loewis, barry, jribbens, rhettinger, pboddie, jamesh, guettli, amaury.forgeotdarc, mark.dickinson, ncoghlan, davidfraser, pitrou, andersjm, catlee, vstinner, techtonik, tomster, werneck, hodgestar, Neil Muller, cameron, eric.araujo, erik.stephens, steve.roberts, r.david.murray, python-dev |
| 2012-06-12 02:27:40 | belopolsky | 修改 | messageid: <1339468060.98.0.34357067838.issue9527@psf.upfronthosting.co.za> |
| 2012-06-12 02:27:40 | belopolsky | 链接 | issue9527 messages |
| 2012-06-12 02:27:39 | belopolsky | 创建 | |
|