--- In
batchworld@..., habs3 <habs3@...> wrote:
>
> Hi All
>
> I am trying to get a date into a variable in a specific format. If
i use %date% i get Mon 02/02/2009. however i need 20090202 as the
format. Any Ideas would be great.
>
You can use the following command to format the date as you need it.
If you are using this command inside a batch file, every percent sign
should appear twice (e.g. %%p %%s, etc):
for /F "usebackq tokens=2-4 delims=^/ " %p in (`date /t`) do echo %r%
p%q
This will take the string 'Mon mm/dd/yyyy and break it in 4 tokens. %
r will be yyyy, %p will be mm and %q will be dd.
To debug your batch files, visit
http://www.steppingsoftware.com.
Running Steps 1.1 is a really cool batch file debugger.
Thanks
GISkier