from pathlib import Path
from datetime import datetime


def get_recording_start(fname):
    """parse the recording date from the emg filename"""

    parts = Path(fname).stem.split(" ")
    subject = parts[0][0:4]
    recdate = datetime.strptime(parts[1], "%Y-%m-%d_%H-%M-%S")
    return recdate