def encode_date_optional_time(obj):
if isinstance(obj, datetime.datetime):<EOL><INDENT>return timezone("<STR_LIT>").normalize(obj.astimezone(timezone("<STR_LIT>"))).strftime('<STR_LIT>')<EOL><DEDENT>raise TypeError("<STR_LIT>".format(repr(obj)))<EOL>
ISO encode timezone-aware datetimes