I need to get the number of milliseconds from 1970-01-01 UTC until now UTC in Java.
I would also like to be able to get the number of milliseconds from 1970-01-01 UTC to any other UTC date time.
From the JavaDoc:
Returns: the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC
long now = Instant.now().toEpochMilli();
Returns: the number of milliseconds since the epoch of 1970-01-01T00:00:00Z -- i.e. pretty much the same as above :-)