How can I convert a timestamp given by Event.Timestamp
to a Date.
For example I have TimeStamp=72052934740143
I am working with Xamarin.ANdroid. And I need to make this conversion even outside the algorithm.
How can I convert a timestamp given by Event.Timestamp
to a Date.
For example I have TimeStamp=72052934740143
I am working with Xamarin.ANdroid. And I need to make this conversion even outside the algorithm.
read : https://wpf.2000things.com/tag/timestamp/
The value of the Timestamp property is an int, rather than a DateTime object. The integer represents the number of milliseconds since the last reboot. When the value grows too large to store in the integer object, it resets to 0. This happens every 24.9 days.
private void TextBox_KeyDown(object sender, KeyEventArgs e)
{
DateTime dt = DateTime.Now;
dt.AddMilliseconds(e.Timestamp - Environment.TickCount);
Trace.WriteLine(string.Format("Key DOWN at: {0}", dt.ToString("h:mm:ss.FFF tt")));
}
or in short:
var dt = DateTime.Now.AddMilliseconds(e.Timestamp - Environment.TickCount);
Try this
double TimeStamp = 72052934740143;
ateTime dt = new DateTime(1970, 1, 1, 0, 0, 0).AddMilliseconds(TimeStamp);