MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / convert

Method convert

src/pendulum/tz/timezone.py:185–199  ·  view source on GitHub ↗
(self, dt: _DT, raise_on_unknown_times: bool = False)

Source from the content-addressed store, hash-verified

183 return self._name
184
185 def convert(self, dt: _DT, raise_on_unknown_times: bool = False) -> _DT:
186 if dt.tzinfo is None:
187 return dt.__class__(
188 dt.year,
189 dt.month,
190 dt.day,
191 dt.hour,
192 dt.minute,
193 dt.second,
194 dt.microsecond,
195 tzinfo=self,
196 fold=0,
197 )
198
199 return cast("_DT", dt.astimezone(self))
200
201 def datetime(
202 self,

Callers 1

datetimeMethod · 0.95

Calls 1

astimezoneMethod · 0.80

Tested by

no test coverage detected