Skip to content

Commit ab4cf17

Browse files
authored
Merge pull request #285 from jemygraw/master
fix the http rft time format from timestamp using utc timezone
2 parents c95c303 + 363c030 commit ab4cf17

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 7.1.7 (2017-09-27)
4+
5+
* 修复从时间戳获取rfc http格式的时间字符串问题
6+
37
## 7.1.6 (2017-09-26)
48

59
*`put_file` 功能增加保持本地文件Last Modified功能,以支持切换源站的客户CDN不回源

qiniu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# flake8: noqa
1111

12-
__version__ = '7.1.6'
12+
__version__ = '7.1.7'
1313

1414
from .auth import Auth, QiniuMacAuth
1515

qiniu/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,6 @@ def rfc_from_timestamp(timestamp):
167167
Args:
168168
timestamp: 整型Unix时间戳(单位秒)
169169
"""
170-
last_modified_date = datetime.fromtimestamp(timestamp)
170+
last_modified_date = datetime.utcfromtimestamp(timestamp)
171171
last_modified_str = last_modified_date.strftime('%a, %d %b %Y %H:%M:%S GMT')
172172
return last_modified_str

0 commit comments

Comments
 (0)