Ejemplo n.º 1
0
 def test_strptime_with_utc(self):
     dt = RichDateTime.strptime('20001231045607', '%Y%m%d%H%M%S', self.utc)
     self.assertEqual(dt, datetime(2000, 12, 31, 4, 56, 7, tzinfo=self.utc))
     self.assertEqual(dt.tzinfo, self.utc)
Ejemplo n.º 2
0
 def test_strptime_with_specified_timezone(self):
     dt = RichDateTime.strptime('20001231045607', '%Y%m%d%H%M%S', self.jst)
     self.assertEqual(dt, datetime(2000, 12, 31, 4, 56, 7, tzinfo=self.jst))
     self.assertEqual(dt.tzinfo, self.jst)
Ejemplo n.º 3
0
 def test_strptime_without_tzinfo(self):
     dt = RichDateTime.strptime('20001231045607', '%Y%m%d%H%M%S')
     self.assertEqual(dt, datetime(2000, 12, 31, 4, 56, 7, tzinfo=tzlocal()))
     self.assertEqual(dt.tzinfo, tzlocal())