Skip to content

Commit 703934a

Browse files
committed
Add test for conversion between dateutil.tz.tzutc() and dateutil.tz.gettz('UTC')
1 parent 7b6a650 commit 703934a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tseries/tests/test_timezones.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,19 @@ def cmptz(self, tz1, tz2):
788788
def localize(self, tz, x):
789789
return x.replace(tzinfo=tz)
790790

791+
def test_utc_with_system_utc(self):
792+
from pandas.tslib import maybe_get_tz
793+
794+
# from system utc to real utc
795+
ts = Timestamp('2001-01-05 11:56', tz=maybe_get_tz('dateutil/UTC'))
796+
# check that the time hasn't changed.
797+
self.assertEqual(ts, ts.tz_convert(dateutil.tz.tzutc()))
798+
799+
# from system utc to real utc
800+
ts = Timestamp('2001-01-05 11:56', tz=maybe_get_tz('dateutil/UTC'))
801+
# check that the time hasn't changed.
802+
self.assertEqual(ts, ts.tz_convert(dateutil.tz.tzutc()))
803+
791804

792805
class TestTimeZones(tm.TestCase):
793806
_multiprocess_can_split_ = True

0 commit comments

Comments
 (0)