I am using md "%date%". This makes a folder named 24-11-2016, but i don't want the separator '-'. It should name the folder as 24112016.
Asked
Active
Viewed 33 times
-2
-
What language you are talking about? – Jens Nov 24 '16 at 08:00
-
basic cmd command – Sanat Nov 24 '16 at 08:04
-
1Possible duplicate: [Batch command date and time in file name](http://stackoverflow.com/q/7727114/5047996) – aschipfl Nov 24 '16 at 10:50
1 Answers
-1
I found the answer :
%DATE:~0,2%%DATE:~3,2%%DATE:~6,4%
~0 Signifies that day should start at 0th place and the 2 following the ',' signifies that it should take two places. Same way ~3 signifies that month start at 3rd place and the 2 following that signifies that it should take two places and ~6 signifies that year should start at 6th place and the 4 following signifies that it should take four places
The Output comes as : 24112016, if you want 24-11-2016 then simply write %date%.

Sanat
- 1
- 1
- 1
- 3
-
This is only an answer if the machine has regional settings for the date format to be DD-MM-YYYY. Have a look at `wmic os get LocalDateTime` which always outputs the same format. – lit Nov 25 '16 at 19:20