from datetime import datetime


def convert_to_datetime(date: str, time: str) -> datetime:
    """
    Converts a date and time string into a datetime object.
    """
    return datetime.strptime(date + time, '%Y-%m-%d%I:%M %p')