txturbo Posted January 17, 2019 Share Posted January 17, 2019 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? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 17, 2019 Share Posted January 17, 2019 %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])) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.