PR#2569: Revert "timezones for py 2.7"
Merges #2569 https://pagure.io/koji/pull-request/2569 Fixes: #2568 https://pagure.io/koji/issue/2568 revert timezone handling for py 2.7
This commit is contained in:
commit
d0a40630a0
1 changed files with 4 additions and 0 deletions
|
|
@ -3307,6 +3307,10 @@ def formatTimeLong(value):
|
|||
t = datetime.datetime.fromtimestamp(value)
|
||||
else:
|
||||
t = value
|
||||
# return date in local timezone, py 2.6 has tzone as astimezone required parameter
|
||||
# would work simply as t.astimezone() for py 2.7+
|
||||
if t.tzinfo is None:
|
||||
t = t.replace(tzinfo=dateutil.tz.gettz())
|
||||
t = t.astimezone(dateutil.tz.gettz())
|
||||
return datetime.datetime.strftime(t, '%a, %d %b %Y %H:%M:%S %Z')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue