|
Answer» hi...
i know how to to CURRENT date VALUE but i don know how to get a value of today's date minus 1 day.
i wan to get yesterday's date.
appreciate all yr helpuse set /a
set /a d=%d%-1 What's %d%?
For me, echo %date% in Command Prompt is 01-Jul-08 So... set /a d=%date:~0,2% would give me 01
And then set /a yesterday=%d%-1 would give you yesterday's date.
However, it will say 00 instead of 30 why are you guys using DOS to do date arithmetic ? Its time to move on
OP. Use the next better LANGUAGE that M$ provides you, out of the box
Code: [Select]WScript.Echo DateAdd("d", -1, Now)
save the above as yesterday.vbs on the command prompt
Code: [Select]c:\test> CSCRIPT /nologo yesterday.vbs many thx for all yr respond.
on the WScript thingy, u r saying it is out of box? cant locate it in my PC/server. still on Win2000 & server is Win2003. sorry... kindly ignore my earlier respond. got it!
again, many2 thx for your help. now JEZ need to further improve on getting the information out of the result...
|