from datetime import datetime


def datetime_to_unix_ms(dt: datetime) -> int:
    """Convert a Python ``datetime`` object to a Unix millisecond timestamp.

    This is necessary as the timestamps Cook returns in its API are in
    milliseconds, while the Python ``datetime`` API uses seconds for Unix
    timestamps.
    """
    return int(dt.timestamp() * 1000)