CSharp examples for System:DateTime Unix
Converts a Unix time to DateTime
using System;/*from w w w . j a va2s . c o m*/ public class Main{ /// <summary> /// Converts a Unix time to DateTime /// </summary> /// <param name="unixTimeStamp"></param> /// <returns></returns> public static DateTime ToDateTime(this long unixTimeStamp) { DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0); return origin.AddSeconds(unixTimeStamp); } }