import time


def timestamp(theTime=time.localtime(), separator="_") -> str:
    """
    Returns a string suitable for appending to a filename, for example, as a timestamp.
    """
    return time.strftime(
        "%Y" + separator + "%m" + separator + "%d" + separator + "%H%M%S", theTime
    )