CSharp examples for System:DateTime Unix
To Unix Time Ms from DateTime
using System.Text; using System.Collections.Generic; using System;/*from ww w .j a va2s . c o m*/ public class Main{ public static long ToUnixTimeMs(this DateTime date) { var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); return Convert.ToInt64((date - epoch).TotalMilliseconds); } }