def sitemap_time_format(dt): if dt.tzinfo: dt = dt.astimezone(UTC_TIMEZONE) return dt.strftime('%Y-%m-%dT%H:%M:%S+00:00')