This isn't a JPSoft issue specifically, but it does affect tcmd/tcc.
No, I don't have a time machine. Does anyone else get this result?
Code:
25.6G C:\Users\jabelli> do forever (echos %_date %_time- & uptime & delay 3600)
2011-08-02 09:57:13-Up since 2011-08-01 10:28:47 (23h 28m 42s)
2011-08-02 10:57:29-Up since 2011-08-01 10:28:47 (1d 28m 43s)
2011-08-02 11:57:30-Up since 2011-08-01 15:54:21 (20h 3m 10s)
2011-08-02 12:57:31-Up since 2011-08-01 15:54:21 (21h 3m 11s)
2011-08-02 13:57:33-Up since 2011-08-01 15:54:21 (22h 3m 16s)
2011-08-02 14:57:37-Up since 2011-08-01 15:54:21 (23h 3m 17s)
Code:
@REM uptime.btm
@echo off
setlocal
set bootDT=%@left[14,%@wmi[.,"SELECT LastBootUpTime FROM Win32_OperatingSystem"]]
set nowDT=%@left[14,%@wmi[.,"SELECT LocalDateTime FROM Win32_OperatingSystem"]]
set bootD=%@left[4,%bootDT]-%@instr[4,2,%bootDT]-%@instr[6,2,%bootDT]
set bootT=%@instr[8,2,%bootDT]:%@instr[10,2,%bootDT]:%@instr[12,2,%bootDT]
set nowD=%@left[4,%nowDT]-%@instr[4,2,%nowDT]-%@instr[6,2,%nowDT]
set nowT=%@instr[8,2,%nowDT]:%@instr[10,2,%nowDT]:%@instr[12,2,%nowDT]
set upSec=%@eval[(%@makeage[%nowD,%nowT]-%@makeage[%bootD,%bootT])/1e+7]
set upD=%@eval[%upSec\86400]
set upH=%@eval[(%upSec %% 86400)\3600]
set upM=%@eval[(%upSec %% 86400)\60 %% 60]
set upS=%@eval[%upSec %% 86400 %% 60]
echo Up since %bootD %bootT (%@if[%upD GT 0,%[upD]d ,]%@if[%upH GT 0,%[upH]h ,]%@if[%upM GT 0,%[upM]m ,]%@if[%upS GT 0,%[upS]s ,]^b)