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

Method normalize

tests/test_code/py/pytz/__init__.py:429–435  ·  view source on GitHub ↗

Correct the timezone information on the given datetime

(self, dt, is_dst=False)

Source from the content-addressed store, hash-verified

427 return dt.replace(tzinfo=self)
428
429 def normalize(self, dt, is_dst=False):
430 '''Correct the timezone information on the given datetime'''
431 if dt.tzinfo is self:
432 return dt
433 if dt.tzinfo is None:
434 raise ValueError('Naive time - no tzinfo set')
435 return dt.astimezone(self)
436
437
438def FixedOffset(offset, _tzinfos={}):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected