I am connecting to an API and one of the parameters is Long (13 digits) to hold the current timestamp in VB.Net which represents milliseconds passed from 0:00:00 01.01.1970 in GMT until
the current time.
The format should be like this 1290932238757
I tried this syntex :
DirectCast((Datetime.Now - New DateTime(1970, 1, 1)).TotalMilliseconds, Int64)
But the output was :
01/12/2013 02:06:24
If I understand correctly, does this work?
I’ve used
DateTime.UtcNowin the example, but you can useDateTime.Nowdepending on how you plan on using the data. See this thread for more information on the difference.