我们从Python开源项目中,提取了以下21个代码示例,用于说明如何使用pytz.common_timezones_set()。
def test_bratislava(self): # Bratislava is the default timezone for Slovakia, but our # heuristics where not adding it to common_timezones. Ideally, # common_timezones should be populated from zone.tab at runtime, # but I'm hesitant to pay the startup cost as loading the list # on demand whilst remaining backwards compatible seems # difficult. self.assertTrue('Europe/Bratislava' in pytz.common_timezones) self.assertTrue('Europe/Bratislava' in pytz.common_timezones_set)
def test_us_eastern(self): self.assertTrue('US/Eastern' in pytz.common_timezones) self.assertTrue('US/Eastern' in pytz.common_timezones_set)
def test_belfast(self): # Belfast uses London time. self.assertTrue('Europe/Belfast' in pytz.all_timezones_set) self.assertFalse('Europe/Belfast' in pytz.common_timezones) self.assertFalse('Europe/Belfast' in pytz.common_timezones_set)