CSharp examples for System:DateTime Unix
Datetime from an int representing a unix epoch time
using System;//from ww w . ja va2 s. c om public class Main{ /// <summary> /// Datetime from an int representing a unix epoch time /// </summary> /// <param name="msSinceEpoch"></param> /// <returns></returns> public static DateTimeOffset EpochMillisecondsToDateTime(this long msSinceEpoch) { var date = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero); return date.AddMilliseconds(msSinceEpoch); } }