Time since restart


Recommended Posts

I am trying to display the time since last restart but I get a day added to my result:

I set a value at restart then display this: 

FormatDateTime("D: %j H:%H M:%M S:%S",SysTime() -(v.time_of_last_restart[0]))

How do I avoid the offset? 



Link to comment
Share on other sites

%j is day of the year.  There is no 0th day of the year, so it always starts at 1.   To do it you'd need to split it:

"D: " + floor((SysTime() -(v.time_of_last_restart[0]))/86400) + FormatDateTime(" H:%H M:%M S:%S",SysTime() -(v.time_of_last_restart[0]))

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.