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.
Created on 2015年02月03日 11:24 by cameris, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg235338 - (view) | Author: cameris (cameris) | Date: 2015年02月03日 11:24 | |
The following occured on linux with python 3.4.2, the machines local timezone is tz2: >>> import datetime >>> tz1 = datetime.timezone.utc; tz2 = datetime.timezone(datetime.timedelta(seconds=3600)); tz3 = datetime.timezone(datetime.timedelta(seconds=18000)) >>> d1 = datetime.datetime.now(tz=tz1); d2 = datetime.datetime.now(tz=tz2); d3 = datetime.datetime.now(tz=tz3) >>> d1.timestamp(), d2.timestamp(), d3.timestamp() (1422962091.603168, 1422962091.603181, 1422962091.603185) >>> d1.strftime('%s'), d2.strftime('%s'), d3.strftime('%s') ('1422958491', '1422962091', '1422976491') Or in other words: >>> d1.strftime('%s') == str(int(d1.timestamp())), d2.strftime('%s') == str(int(d2.timestamp())), d3.strftime('%s') == str(int(d3.timestamp())) (False, True, False) Expected result of the last line would be (True, True, True). |
|||
| msg235351 - (view) | Author: Alexander Belopolsky (belopolsky) * (Python committer) | Date: 2015年02月03日 16:34 | |
This looks like a duplicate of #12750. |
|||
| msg235356 - (view) | Author: cameris (cameris) | Date: 2015年02月03日 17:19 | |
Yes, this seems to be exactly the same. Searching with "All text*: '%s'" didn't return anything, therefore I thought it is an unknown bug/behaviour. Well, sorry for the duplicate. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:12 | admin | set | github: 67577 |
| 2018年03月25日 16:02:01 | cheryl.sabella | set | status: open -> closed superseder: add cross-platform support for %s strftime-format code resolution: duplicate stage: resolved |
| 2015年02月03日 17:19:20 | cameris | set | messages: + msg235356 |
| 2015年02月03日 16:34:01 | belopolsky | set | messages: + msg235351 |
| 2015年02月03日 14:51:33 | r.david.murray | set | nosy:
+ belopolsky |
| 2015年02月03日 14:30:36 | tunz | set | nosy:
+ tunz |
| 2015年02月03日 11:24:02 | cameris | create | |