MCPcopy
hub / github.com/celery/celery / tz_or_local

Method tz_or_local

celery/utils/time.py:129–135  ·  view source on GitHub ↗

Return either our local timezone or the provided timezone.

(self, tzinfo: tzinfo | None = None)

Source from the content-addressed store, hash-verified

127 """
128
129 def tz_or_local(self, tzinfo: tzinfo | None = None) -> tzinfo:
130 """Return either our local timezone or the provided timezone."""
131
132 # pylint: disable=redefined-outer-name
133 if tzinfo is None:
134 return self.local
135 return self.get_timezone(tzinfo)
136
137 def to_local(self, dt: datetime, local=None, orig=None):
138 """Converts a datetime to the local timezone."""

Callers 3

to_localMethod · 0.95
test_tz_or_localMethod · 0.80
maybe_make_awareFunction · 0.80

Calls 1

get_timezoneMethod · 0.95

Tested by 1

test_tz_or_localMethod · 0.64