def replace(self, year=None, month=None, day=None, hour=None,<EOL>minute=None, second=None, microsecond=None, tzinfo=True):
if year is None:<EOL><INDENT>year = self.year<EOL><DEDENT>if month is None:<EOL><INDENT>month = self.month<EOL><DEDENT>if day is None:<EOL><INDENT>day = self.day<EOL><DEDENT>if hour is None:<EOL><INDENT>hour = self.hour<EOL><DEDENT>if minute is None:<EOL><INDENT>minute = self.minute<EOL><DEDENT>if second is None:<EOL><INDENT>second = self.second<EOL><DEDENT>if microsecond is None:<EOL><INDENT>microsecond = self.microsecond<EOL><DEDENT>if tzinfo is True:<EOL><INDENT>tzinfo = self.tzinfo<EOL><DEDENT>return datetime.__new__(type(self),<EOL>year, month, day, hour, minute, second,<EOL>microsecond, tzinfo)<EOL>
Return a new datetime with new values for the specified fields.