消息 [133245]
On Thu, Apr 7, 2011 at 6:20 AM, Velko Ivanov <report@bugs.python.org> wrote:
..
>> Converting datetime values to float is easy. If your dt is a naive instance representing UTC time:
>>
>> timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)
>>
>> If your dt is an aware instance:
>>
>> timestamp = (dt - datetime(1970, 1, 1, tzinfo=timezone.utc)) / timedelta(seconds=1)
>
> Please add these lines to the datetime module's documentation. In some
> central, well lit place. I believe that if nothing else, the whole
> discussion should have proved to you that there are many people looking
> for them.
This is precisely what I suggested at the end of msg132697 above. See
attached patch (issue2736-doc.diff) for a proposed documentation
enhancement. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2011-04-07 18:32:02 | belopolsky | 修改 | recipients:
+ belopolsky, lemburg, tim.peters, ping, jribbens, guettli, amaury.forgeotdarc, mark.dickinson, davidfraser, pitrou, andersjm, catlee, vstinner, tomster, werneck, hodgestar, Neil Muller, erik.stephens, steve.roberts, r.david.murray, vivanov, Jay.Taylor |
| 2011-04-07 18:31:56 | belopolsky | 链接 | issue2736 messages |
| 2011-04-07 18:31:56 | belopolsky | 创建 | |
|