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

Method instance

src/pendulum/time.py:38–46  ·  view source on GitHub ↗
(
        cls, t: time, tz: str | Timezone | FixedTimezone | datetime.tzinfo | None = UTC
    )

Source from the content-addressed store, hash-verified

36
37 @classmethod
38 def instance(
39 cls, t: time, tz: str | Timezone | FixedTimezone | datetime.tzinfo | None = UTC
40 ) -> Self:
41 tz = t.tzinfo or tz
42
43 if tz is not None:
44 tz = pendulum._safe_timezone(tz)
45
46 return cls(t.hour, t.minute, t.second, t.microsecond, tzinfo=tz, fold=t.fold)
47
48 # String formatting
49 def __repr__(self) -> str:

Calls

no outgoing calls