from pathlib import Path


def get_timestamp(log_path: Path) -> str:
    """
    Opens the provided log file and extracts the timestamp from the
    first line.

    Args:
        log_path: The Path object for the log file.

    Returns:
        The string representation of the timestamp in the format of
        YYYY-MM-DD-HH-MM-SS.
    """
    with log_path.open() as f:
        line = f.readline()

    timestamp = (
        line.split(',')[0]
        .replace(' ', '-')
        .replace(':', '-')
    )

    return timestamp