Time Stamp To Date Time - CSharp System

CSharp examples for System:DateTime Timestamp

Description

Time Stamp To Date Time

Demo Code


using System;//  w ww  .  j a v  a2s.  co m

public class Main{
        public static DateTime TimeStampToDateTime(long timestamp)
      {
         var dt = new DateTime(year: 1970, month: 1, day: 1, hour: 0, minute: 0, second: 0, millisecond: 0, kind: DateTimeKind.Utc);

         return dt.AddSeconds(value: timestamp);
      }
}

Related Tutorials