CSharp examples for System:DateTime Convert
Convert Unix Time To Date Time
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;// w w w . j av a 2 s . com public class Main{ //adapted from- http://stackoverflow.com/questions/249760/how-to-convert-a-unix-timestamp-to-datetime-and-vice-versa public static DateTime ConvertUnixTimeToDateTime(double unix) { DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); dt = dt.AddSeconds(unix).ToLocalTime(); return dt; } }