示例#1
0
    def testLocal(self):
        # Not sure how to pin a local time zone, so for now we're just going
        # to run this and make sure it doesn't raise an error
        # See Github Issue #135: https://github.com/dateutil/dateutil/issues/135
        datetime.now(tzwin.tzwinlocal())

        datetime(2014, 3, 11, tzinfo=tzwin.tzwinlocal()).utcoffset()
示例#2
0
    def testLocal(self):
        # Not sure how to pin a local time zone, so for now we're just going
        # to run this and make sure it doesn't raise an error
        # See Github Issue #135: https://github.com/dateutil/dateutil/issues/135
        datetime.now(tzwin.tzwinlocal())

        datetime(2014, 3, 11, tzinfo=tzwin.tzwinlocal()).utcoffset()
示例#3
0
 def testTzwinLocalUTCOffset(self):
     with TZWinContext('Eastern Standard Time'):
         tzwl = tzwin.tzwinlocal()
         self.assertEqual(
             datetime(2014, 3, 11, tzinfo=tzwl).utcoffset(),
             timedelta(hours=-4))
示例#4
0
文件: test_tz.py 项目: d0f/dateutil
 def testTzwinLocalUTCOffset(self):
     with TZWinContext('Eastern Standard Time'):
         tzwl = tzwin.tzwinlocal()
         self.assertEqual(datetime(2014, 3, 11, tzinfo=tzwl).utcoffset(),
                          timedelta(hours=-4))