예제 #1
0
 def test_tz(self):
     self.assertEqual("+0205", _UTCOffset(125).tzname(datetime.utcnow()))
     self.assertEqual("-0410", _UTCOffset(-250).tzname(datetime.utcnow()))
예제 #2
0
 def test_parse_tz(self):
     self.assertEqual(datetime(2014, 3, 11, 14, 12, tzinfo=_UTCOffset(330)), parse_datetime("201403111412+0530"))
     self.assertEqual(
         datetime(2014, 3, 11, 14, 12, 20, tzinfo=_UTCOffset(-300)), parse_datetime("20140311141220-0500")
     )