MCPcopy
hub / github.com/celery/celery / get_timezone

Method get_timezone

celery/utils/time.py:157–161  ·  view source on GitHub ↗

Returns ZoneInfo timezone if the provided zone is a string, otherwise return the zone.

(self, zone: str | tzinfo)

Source from the content-addressed store, hash-verified

155 return localize(dt, self.local)
156
157 def get_timezone(self, zone: str | tzinfo) -> tzinfo:
158 """Returns ZoneInfo timezone if the provided zone is a string, otherwise return the zone."""
159 if isinstance(zone, str):
160 return ZoneInfo(zone)
161 return zone
162
163 @cached_property
164 def local(self) -> tzinfo:

Callers 5

tz_or_localMethod · 0.95
utcMethod · 0.95
test_nowMethod · 0.80
timezoneMethod · 0.80

Calls

no outgoing calls

Tested by 2

test_nowMethod · 0.64