from datetime import datetime


def date_to_str(dt: datetime) -> str:
    """
    Get date, in string format, from timestamp.

    Parameters
    ----------
    dt : datetime
        Represents a date

    Returns
    -------
    str
        Represents the date in string format

    Example
    -------
    >>> from datetime import datatime
    >>> from pymove.utils.datetime import date_to_str
    >>> time_now = datetime.now()
    >>> print(time_now)
    '2021-04-29 11:01:29.909340'
    >>> print(type(time_now))
    '<class 'datetime.datetime'>'
    >>> print(date_to_str(time_now), type(time_now))
    '2021-04-29   <class 'str'>'
    """
    return dt.strftime('%Y-%m-%d')