CSharp examples for System:DateTime Unix
Calculates the Unix epoch for the date
using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from w ww .j ava 2s . c om*/ public class Main{ /// <summary> /// Calculates the Unix epoch for the date /// </summary> /// <returns>The Unix epoch</returns> public static long ToUnixEpoch(this DateTime date) { return (date.Ticks - 621355968000000000) / 10000000; } }