How to convert a value to type UNIX timestamp (seconds since 1970)
, example 1396148400 , in a DateTime
?
How to convert a value to type UNIX timestamp (seconds since 1970)
, example 1396148400 , in a DateTime
?
A way to treat unix timestamp;
string start = "1396148900"; // o teu exemplo;
// Criar equivalente Datetime > UNIX Epoch. (seconds since 1970)
DateTime dtIni = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
// adicionar o nº de segundos UNIX timestamp para comversão;
dtIni = dateTime.AddSeconds(double.Parse(start));