CSharp examples for System:DateTime Unix
Date Time To Unix Timestamp Seconds
using System;/*from www . j a v a 2 s.c om*/ public class Main{ public static int DateTimeToUnixTimestampSeconds(this DateTime dateTime) { var time = (int)(dateTime - new DateTime(1970, 1, 1).ToLocalTime()).TotalSeconds; return time; } }