I am trying to make an up-time clock in batch. It gets the last boot time and matches it with the current time to create an up-time variable.
I am using this to get the boot time and current time:
wmic os get LastBootUpTime /format:value
wmic os get LocalDateTime /format:value
They both return an output like this:
where "+060" would be the extra amount of minutes to be added, because time sones.
However, when I try to filter the variable into one containing the date, and one containing the time using this:
for /f "tokens=2 delims==" %%A in ('wmic os get LastBootUpTime /format:value') do set lastBoot=%%A
for /f "tokens=2 delims==" %%A in ('wmic os get LocalDateTime /format:value') do set localTime=%%A
I end up with lastBoot1 and lastBoot2 having the same value.
(I didn't do the localDate calculation because it works the same way)
Also, how would I do "time-math" to get the amount of time (in days, hours and minutes) since the last boot? (time-math does silly things with my brain)
If infinity is infinite, is the square root of infinity infinite as well?
- Kurp Von Steiner
message edited by RainBawZ