public static void Main()
DateTime d1 = new DateTime(1970, 1, 1);
DateTime d2 = DateTime.Now;
double x = new TimeSpan(d2.Ticks - d1.Ticks).TotalMilliseconds;
double y =((DateTimeOffset)DateTime.UtcNow).ToUnixTimeMilliseconds();
Console.WriteLine("Calculo com Ticks {0}",x);
Console.WriteLine("Calculo com UtcNow {0}",y);
Console.WriteLine("Data com millisegundos: {0:MM/dd/yyy HH:mm:ss.fff}, {1}", DateTime.Now,DateTime.Now.Millisecond);