from datetime import datetime


def format_datetime(dt: datetime) -> str:
    """
    Format a datetime object as string.

    :param dt: Date and time to format.
    :return: String representation.
    """
    return dt.strftime("%Y-%m-%d %H:%M:%S%z")