from datetime import datetime


def datetime_to_str(dt: datetime) -> str:
    """Get a timestamp string from a datetime object.

    Args:
        dt: The datetime object.
    Returns:
        The timestamp string.
    """
    return dt.strftime("%Y_%m_%d_%H_%M_%S")