from datetime import datetime


def datetime2sql(dt: datetime) -> str:
    """
    Converts datetime format into SQL string format. Also applies the "to_date" function
    Args:
        dt: An datetime object

    Returns:
    String containing the datetime
    """
    return f"to_date('{dt.strftime('%Y-%m-%d %H:%M:%S')}', 'YYYY-MM-DD HH24:MI:SS')"