From Unix Timestamp - CSharp System

CSharp examples for System:DateTime Unix

Description

From Unix Timestamp

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from   w  w  w. jav a2 s .co m

public class Main{
        public static DateTime FromUnixTimestamp(long timestamp)
        {
            DateTime unixRef = new DateTime(1970, 1, 1, 0, 0, 0);
            return unixRef.AddSeconds(timestamp);
        }
}

Related Tutorials