txturbo

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? 

 

 

Share this post


Link to post
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]))

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now