Re: get date - 1 day

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Hassan" <hassan@xxxxxxxx> wrote in message
news:emUaGwoQIHA.280@xxxxxxxxxxxxxxxxxxxxxxx
How can i get the value of the date i.e. one day minus todays date

I tried echo %date-1%

and even echo %date% -1


Doing date arithmetic in a batch file is cumbersome
because you have to write your own routines to
calculate the number of days since an artifical start
date, e.g. 1 January 1970. Use VB Scripting -
it has a full set of functions designed specifically
for this purpose.


.



Relevant Pages

  • Re: get date - 1 day
    ... I tried echo %date-1% ... Doing date arithmetic in a batch file is cumbersome ... because you have to write your own routines to ...
    (microsoft.public.scripting.vbscript)
  • Re: Anther contender to the Mac Mini....
    ... GreyCloud wrote ... > The main trouble tho is that most of the OS X routines are ... There's an echo in here. ...
    (comp.sys.mac.advocacy)
  • Re: Persisting env vars in cmd windows
    ... The help text for the command you question goes like this: ... format by typing this: echo %date% ... If you don't then the batch file will fail. ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Win2000 Printing Nightmare
    ... Purge the print spooler, to do so at a command prompt issue the ... You can make a small batch file to do the above job, ... @echo off ... ping localhost -n 4> nul ...
    (microsoft.public.win2000.file_system)
  • Re: logging batch files
    ... @echo off ... REM the start of your batch file ... >set LogCmd= ... >:LogIt ...
    (microsoft.public.win2000.cmdprompt.admin)