Message142168
| Author |
lemburg |
| Recipients |
lemburg, maksbotan |
| Date |
2011年08月16日.08:11:48 |
| SpamBayes Score |
1.4832427e-08 |
| Marked as misclassified |
No |
| Message-id |
<4E4A263F.4050900@egenix.com> |
| In-reply-to |
<1313481124.28.0.0943950907585.issue12758@psf.upfronthosting.co.za> |
| Content |
Maxim Koltsov wrote:
>
> New submission from Maxim Koltsov <kolmax94@gmail.com>:
>
> Python docs (http://docs.python.org/library/time.html#time.time) say that time.time() function should return UTC timestamp, but actually i get local one:
>>>> time.mktime(time.gmtime()), time.time(), time.mktime(time.localtime())
> (1313466499.0, 1313480899.384221, 1313480899.0)
> As you can see, the result of second statement is equal to result of the third, while it must be equal to result of the first. Checked on 2.7 and 3.1. My OS is Gentoo/Linux, timezone-info is the latest version (2011h).
The description in the docs is a bit misleading.
time.time() returns the local time in number of seconds since the epoch
(1970年01月01日 00:00:0O UTC).
UTC refers to the epoch, not the timezone used by time.time(). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年08月16日 08:11:49 | lemburg | set | recipients:
+ lemburg, maksbotan |
| 2011年08月16日 08:11:48 | lemburg | link | issue12758 messages |
| 2011年08月16日 08:11:48 | lemburg | create |
|