Date Time To Unix Timestamp - CSharp System

CSharp examples for System:DateTime Unix

Description

Date Time To Unix Timestamp

Demo Code


using System;/* w  ww  .  java  2 s.c o m*/

public class Main{
        public static double DateTimeToUnixTimestamp(this DateTime dateTime)
        {
            var time = (dateTime - new DateTime(1970, 1, 1).ToLocalTime()).TotalMilliseconds;
            return time;
        }
}

Related Tutorials