Need to edge out the competition for your dream job? Train for certifications today.
This course will introduce you to C++ 11 and teach you about syntax fundamentals.
IF /I %HR% GTR 0 (GOTO LoopDate)
SET /A HR=%HR% + 24 :: Changed from 23
SET /A DD=%DD% - 1
SET /A HR=%HR%
:: Added next 4 lines
IF /I %HR% EQU 24 (
SET /A HR=0 :: If at 24 hours set to 00 for midnight
SET /A DD=%DD%+1 :: Add the day back that was previously subtracted.
IF /I %DD% GTR 0 (GOTO DONE)
set /A mm=%mm% - 1
if /I %mm% GTR 0 goto ADJUSTDAY
set /A mm=12
set /A yyyy=%yyyy% - 1
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.