Get Date Time From Timestamp - CSharp System

CSharp examples for System:DateTime Timestamp

Description

Get Date Time From Timestamp

Demo Code


using System.Web;
using System.Linq;
using System.Collections.Generic;
using System;//from  ww w.  j  a va2  s . c o m

public class Main{
        public static DateTime GetDateTimeFromTimestamp(string timestamp)
        {
            DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
            origin = origin.AddSeconds(Convert.ToDouble(timestamp));
            return origin.ToLocalTime();
        }
}

Related Tutorials