To Date Time from timestamp - CSharp System

CSharp examples for System:DateTime Timestamp

Description

To Date Time from timestamp

Demo Code


using System.Web;
using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using System;/*  w ww .  j  a  v  a2  s .  co  m*/

public class Main{
        public static DateTime ToDateTime(this DateTime target, long timestamp)
        {
            var dateTime = new DateTime(1970, 1, 1, 0, 0, 0, target.Kind);

            return dateTime.AddSeconds(timestamp);
        }
}

Related Tutorials