CSharp examples for System:DateTime Unix
Calculates the Unix epoch minutes for the date
using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from ww w . j av a 2 s . c om*/ public class Main{ /// <summary> /// Calculates the Unix epoch minutes for the date /// </summary> /// <returns>The Unix epoch minutes</returns> public static long ToUnixEpochMinutes(this DateTime date) { return date.ToUnixEpoch() / 60; } /// <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; } }