We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0052cc commit 18761b5Copy full SHA for 18761b5
pandas/_libs/tslibs/timezones.pyx
@@ -18,9 +18,6 @@ cimport numpy as cnp
18
from numpy cimport int64_t
19
cnp.import_array()
20
21
-UTC_EQ_STR = 'Etc/GMT'
22
-UTC_EQ = pytz.timezone(UTC_EQ_STR)
23
-
24
# ----------------------------------------------------------------------
25
from pandas._libs.tslibs.util cimport is_integer_object, get_nat
26
@@ -80,8 +77,13 @@ cpdef inline object get_timezone(object tz):
80
77
if zone is None:
81
78
return tz
82
79
83
- # UTC and Etc/GMT are the same timezones
84
- if zone == UTC_EQ or zone == UTC_EQ_STR:
+ # UTC and Etc/GMT or Etc/GMT+0 are the same timezones
+ if not isinstance(zone, str):
+ str_zone = str(zone)
+ else:
+ str_zone = zone
85
+
86
+ if str_zone == 'Etc/GMT' or str_zone == 'Etc/GMT+0':
87
return UTC
88
return zone
89
except AttributeError:
0 commit comments