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

Method localize

tests/test_code/py/pytz/__init__.py:242–246  ·  view source on GitHub ↗

Convert naive time to local time

(self, dt, is_dst=False)

Source from the content-addressed store, hash-verified

240 return _UTC, ()
241
242 def localize(self, dt, is_dst=False):
243 '''Convert naive time to local time'''
244 if dt.tzinfo is not None:
245 raise ValueError('Not naive datetime (tzinfo is already set)')
246 return dt.replace(tzinfo=self)
247
248 def normalize(self, dt, is_dst=False):
249 '''Correct the timezone information on the given datetime'''

Callers 1

fromutcMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected