Revert "timezones for py 2.7"
This reverts commit a9108584b7.
Fixes: https://pagure.io/koji/issue/2568
This commit is contained in:
parent
f12c92d10d
commit
2012ae64ec
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