from datetime import datetime


def parse_datetime(dt_str: str):
    """
    Convert timestamp string to datetime object.
    """
    try:
        dt = datetime.strptime(dt_str, "%Y-%m-%d %H:%M:%S.%f")
    except ValueError:
        dt = datetime(1970, 1, 1)
    return dt