Date.now() returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC. The Python 3.3 and later equivalent is:
from datetime import datetime, timezone
now_ms = int(datetime.now(tz=timezone.utc).timestamp() * 1000)
Without tz=timezone.utc, datetime.timestamp will use a naive datetime, usually set to your local time with timezone, daylight savings time, etc. This can be a subtle source of bugs, when going from Python to Javascript, between development environments and production, or around daylight savings time transitions.