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

Method in_timezone

src/pendulum/datetime.py:345–355  ·  view source on GitHub ↗

Set the instance's timezone from a string or object.

(self, tz: str | Timezone | FixedTimezone)

Source from the content-addressed store, hash-verified

343 )
344
345 def in_timezone(self, tz: str | Timezone | FixedTimezone) -> Self:
346 """
347 Set the instance's timezone from a string or object.
348 """
349 tz = pendulum._safe_timezone(tz)
350
351 dt = self
352 if not self.timezone:
353 dt = dt.replace(fold=1)
354
355 return tz.convert(dt)
356
357 def in_tz(self, tz: str | Timezone | FixedTimezone) -> Self:
358 """

Calls 2

replaceMethod · 0.45
convertMethod · 0.45