def test_utc_offset(self): if time.localtime().tm_isdst: system_timezone = -time.altzone else: system_timezone = -time.timezone ok_(_utc_offset(datetime.datetime.now(), True) == system_timezone) ok_(not _utc_offset(datetime.datetime.now(), False))
def setUp(self): local_utcoffset = _utc_offset(datetime.datetime.now(), True) self.local_utcoffset = datetime.timedelta(seconds=local_utcoffset) self.local_timezone = _timezone(local_utcoffset)