from datetime import datetime


def str_to_date(date, hour):
    """Converts str type date and hour to datetime object

    Datetime object provides operations. This package converts the datetime string
    into a datetime object to get the correct dueDate and dueHour. All dates should
    be in `isoformat`.

    Args:
        date: YYYY-MM-DD,  Y=Year, M=Month, D=Day, formatted date string
        hour: HH:MM:SS, H=Hour, M=Minute, S=Seconds, formatted hour string

    Returns:
        date_time_obj: a datetime.datetime object
    """
    due_date = [int(x) for x in date.split('-')]
    due_hour = [int(x) for x in hour.split(':')]
    # Year, month, day, hour, minute, seconds
    date_time_obj = datetime(due_date[0], due_date[1], due_date[2],
                             due_hour[0], due_hour[1], due_hour[2])

    return date_time_obj