|Photo by Rich Masso|
My first attempt to convert the current UTC time was not successful:
select Datediff(s, '1970-01-01', GETUTCDATE())*1000 Msg 8115, Level 16, State 2, Line 1 Arithmetic overflow error converting expression to data type int.
Since the number of milliseconds is greater than the precision of int, we have to bring up the big guns: "bigint".
select cast(Datediff(s, '1970-01-01', GETUTCDATE()) AS bigint)*1000
This worked great. A good site to check the values is www.epochconverter.com.