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

Method normalize

tests/test_code/py/pytz/__init__.py:248–254  ·  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

246 return dt.replace(tzinfo=self)
247
248 def normalize(self, dt, is_dst=False):
249 '''Correct the timezone information on the given datetime'''
250 if dt.tzinfo is self:
251 return dt
252 if dt.tzinfo is None:
253 raise ValueError('Naive time - no tzinfo set')
254 return dt.astimezone(self)
255
256 def __repr__(self):
257 return "<UTC>"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected