from datetime import datetime


def ts(time: datetime) -> float:
    """
    Converts a Python datetime to a JavaScript-style timestamp (milliseconds). Not 100% accurate.

    Parameters
    ----------
    time: :class:`datetime.datetime`
        Datetime to convert.

    Returns
    -------
    float:
        Number of milliseconds elapsed since 1970.
    """
    return time.timestamp() * 1000