If the current date returned by date is 2008-05-23, then under DOS how can I get the date N days earlier, for example 2 days earlier would be 2008-05-21
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Originally posted by jiulong at 2008-5-26 03:29 PM:
@echo off
set a=%date:~0,4%
set b=%date:~5,2%
set/a c=%date:~8,2%-2
echo The date two days earlier is: %a% year %b% month %c% day
pause
If this solves it, give me some credits ah
[ Last edited by jiulong on 2008-5-26 at 09:03 PM ]