MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / localize

Method localize

tests/test_code/py/pytz/tzinfo.py:112–116  ·  view source on GitHub ↗

Convert naive time to local time

(self, dt, is_dst=False)

Source from the content-addressed store, hash-verified

110 return self._tzname
111
112 def localize(self, dt, is_dst=False):
113 '''Convert naive time to local time'''
114 if dt.tzinfo is not None:
115 raise ValueError('Not naive datetime (tzinfo is already set)')
116 return dt.replace(tzinfo=self)
117
118 def normalize(self, dt, is_dst=False):
119 '''Correct the timezone information on the given datetime.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected