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

Method localize

tests/test_code/py/pytz/__init__.py:423–427  ·  view source on GitHub ↗

Convert naive time to local time

(self, dt, is_dst=False)

Source from the content-addressed store, hash-verified

421 return 'pytz.FixedOffset(%d)' % self._minutes
422
423 def localize(self, dt, is_dst=False):
424 '''Convert naive time to local time'''
425 if dt.tzinfo is not None:
426 raise ValueError('Not naive datetime (tzinfo is already set)')
427 return dt.replace(tzinfo=self)
428
429 def normalize(self, dt, is_dst=False):
430 '''Correct the timezone information on the given datetime'''

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected