private string ConvertUnixEpochTime(long epoch)
{
try
{
long baseTicks = 621355968000000000;
long tickResolution = 10000000;
long epochNegative = 1000000000;
long epochTicks = (epoch - epochNegative * tickResolution) + baseTicks; string date = new DateTime(epochTicks, DateTimeKind.Utc).ToString();
return date;
}
catch (Exception exp)
{
}
return string.Empty;
}
Kullanımı :
private void button1_Click(object sender, EventArgs e)
{
txtMesaj.Text = ConvertUnixEpochTime(epoch format);
}
Hiç yorum yok:
Yorum Gönder