I am currently parsing the XML file from Telldus Live. When I access the sensors there is the "lastUpdated" attribute for each sensor. How is that value measured?
I need it to convert it into something more readable...
How is "lastUpdated" attribute measured?
Moderator: Telldus
Re: How is "lastUpdated" attribute measured?
It's the number of seconds since January 1, 1970, 00:00:00.
If you, for example, want to convert it to a java Date you just do
And for C# DateTime
If you, for example, want to convert it to a java Date you just do
Code: Select all
new Date(timestamp*1000); //tick = 1 millisec
Code: Select all
DateTime lastUpdated = new DateTime(1970, 1, 1, 0, 0, 0, 0);
lastUpdated.AddSeconds(timestamp);