from datetime import datetime


def filename_timestamp(timestamp=None):
    """Generate a timestamp suitable to specify a file."""
    if timestamp is None:
        timestamp = datetime.now()

    time_format = '%Y-%m-%d_%H_%M_%S'
    return timestamp.strftime(time_format)