Skip to content

Commit d3412e2

Browse files
committed
fixed bug: 'UTC' and 'Etc/GMT' should be the same
1 parent c35e124 commit d3412e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/_libs/tslibs/timezones.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ cimport numpy as cnp
1818
from numpy cimport int64_t
1919
cnp.import_array()
2020

21+
UTC_EQ_STR = 'Etc/GMT'
22+
UTC_EQ = pytz.timezone(UTC_EQ_STR)
23+
2124
# ----------------------------------------------------------------------
2225
from pandas._libs.tslibs.util cimport is_integer_object, get_nat
2326

@@ -76,6 +79,8 @@ cpdef inline object get_timezone(object tz):
7679
zone = tz.zone
7780
if zone is None:
7881
return tz
82+
if zone == UTC_EQ or zone == UTC_EQ_STR:
83+
return UTC
7984
return zone
8085
except AttributeError:
8186
return tz

0 commit comments

Comments
 (0)