How is "lastUpdated" attribute measured?

Moderator: Telldus

Post Reply
peso70
Posts: 4
Joined: Fri Mar 17, 2023 9:45 am

How is "lastUpdated" attribute measured?

Post by peso70 »

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...
Zaman
Posts: 243
Joined: Fri Mar 17, 2023 9:45 am

Re: How is "lastUpdated" attribute measured?

Post by Zaman »

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

Code: Select all

new Date(timestamp*1000); //tick = 1 millisec
And for C# DateTime

Code: Select all

DateTime lastUpdated = new DateTime(1970, 1, 1, 0, 0, 0, 0);
lastUpdated.AddSeconds(timestamp);
Post Reply