
TM> Anyone knowdof a way to*move the time over the date line | process |
TM> move the time back - in a batch file. Failing that,*anyone knowdof a
TM> util that'll do it?

JD>Let's see, maybe this'll work:

JD>DATE %@SUBSTR[%_DATE,0,3]%@EVAL[%@SUBSTR[%_DATE,2,2]+1]%@SUBSTR[%_DATE,4]
JD>...(PROCESSING COMMANDS)
JD>DATE %@SUBSTR[%_DATE,0,3]%@EVAL[%@SUBSTR[%_DATE,2,2]-1]%@SUBSTR[%_DATE,4]

This was a start in the right direction, and it got me thinking.  I
wrote two batch files: INCDAY.BTM and DECDAY.BTM.  They will work
properly until the year 2100 (!).  Here they are:

REM * This is INCDAY.BTM...

set day=%@substr[%_date,3,2]
set mon=%@substr[%_date,0,2]
set year=%@substr[%_date,6,2]

iff %@eval[%year/4] EQ %@int[%@eval[%year/4]] then
  set dayspermon=312931303130313130313031
else
  set dayspermon=312831303130313130313031
endiff

iff %day LT %@substr[%dayspermon,%@eval[%mon*2-2],2] then
  set day=%@eval[%day+1]
  goto done
elseiff %mon LT 12 then
  set mon=%@eval[%mon+1]
  set day=01
  goto done
else
  set year=%@eval[%year+1]
  set mon=01
  set day=01
endiff

:done
*date %mon%-%day%-%year%
unset day mon year dayspermon

REM * End of INCDAY.BTM

REM * This is DECDAY.BTM

set day=%@substr[%_date,3,2]
set mon=%@substr[%_date,0,2]
set year=%@substr[%_date,6,2]

iff %@eval[%year/4] EQ %@int[%@eval[%year/4]] then
  set dayspermon=312931303130313130313031
else
  set dayspermon=312831303130313130313031
endiff

iff %day GT 01 then
  set day=%@eval[%day-1]
  goto done
elseiff %mon GT 01 then
  set mon=%@eval[%mon-1]
  set day=%@substr[%dayspermon,%@eval[%mon*2-2],2]
  goto done
else
  set year=%@eval[%year-1]
  set mon=12
  set day=31
endiff

:done
*date %mon%-%day%-%year%
unset day mon year dayspermon

REM * End of DECDAY.BTM

