Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
phillid
- Posts: 109
- Joined: 03 Apr 2010 20:27
- Location: Wellington, New Zealand
-
Contact:
#1
Post
by phillid » 04 Aug 2010 23:31
Hello again. I am using the %date% and %time% variables in a program, but I need to take the / and the : out of them to leave me with just a number like 21072010. I know that I need to use a FOR loop, but I'm still working on how to use them.
Thanks, guys.
phillid
-
!k
- Expert
- Posts: 378
- Joined: 17 Oct 2009 08:30
- Location: Russia
#2
Post
by !k » 05 Aug 2010 02:07
-
jeb
- Expert
- Posts: 1057
- Joined: 30 Aug 2007 08:05
- Location: Germany, Bochum
#3
Post
by jeb » 05 Aug 2010 04:29
Or you can use it like
Code: Select all
set now=%time%
echo %now:~0,2%_%now:~3,2%_%now:~6,2%
Also, you can read about it with set /?
![Wink :wink:](./images/smilies/icon_wink.gif)