from datetime import datetime


def datetime_to_discord(time: datetime, format: str = "f") -> str:
    """Convert a datetime object to a Discord timestamp."""
    return f"<t:{int(time.timestamp())}:{format}>"