def datetime_to_str(value, fmt="%Y-%m-%d %H:%M:%S"):
    """ 时间类型转换为字符串。datetime to string.

    :type value: datetime.datetime
    :type fmt: str
    :rtype: str
    """
    return value.strftime(fmt)