from datetime import datetime


def to_datetime(datetime_str: str, sep: str = ":") -> datetime:
    """Convert datetime formatted string to datetime object.
    Arguments:
    ---
     datetime_str: datetime value in string
     sep: separator for time in datetime string

    returns:
    ---
     return datetime object representing the input string
    """
    return datetime.strptime(datetime_str, f"%Y-%m-%d-%H{sep}%M{sep}%S")