-2

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.

Jens
  • 67,715
  • 15
  • 98
  • 113
Sanat
  • 1
  • 1
  • 1
  • 3

1 Answers1

-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