from datetime import datetime


def datetime_to_str(dt: datetime) -> str:
    """
    Converts a date in datetime format to string format.

    Parameters
    ----------
    dt : datetime
        Represents a datetime in datetime format.

    Returns
    -------
    str
        Represents a datetime in string format "%Y-%m-%d %H:%M:%S".

    Example:
    -------
    >>> from pymove.utils.datetime import datetime_to_str
    >>> from datetime import datetime
    >>> time_now = datetime.now()
    >>> print(time_now)
    '2021-04-29 14:15:29.708113'
    >>> print(type(time_now))
    '<class 'datetime.datetime'>'
    >>> print(datetime_to_str(time_now), type(datetime_to_str(time_now)))
    '2021-04-29 14:15:29  <class 'str' >'
    """
    return dt.strftime('%Y-%m-%d %H:%M:%S')