from typing import Union
import pathlib
from datetime import datetime


def get_timestamp(file_path: Union[str, pathlib.Path]) -> str:
    """Return a textual timestamp from the modification date of a file

    Args:
        file_path:  Path to file.

    Returns:
        String representing the modification date of the file.
    """
    file_path = pathlib.Path(file_path)

    try:
        mod_time = file_path.stat().st_mtime
    except FileNotFoundError:
        return "File does not exist"

    return datetime.fromtimestamp(mod_time).isoformat()