0

I am trying to format the date and time in using batch scripting so that my file corresponds to current date time.

if current date time is:2015.09.02.13:21:22

I would like the file to be called: TEST.2015.09.02.13:21:22

Is this doable?

Michael Minella
  • 20,843
  • 4
  • 55
  • 67
Angelina
  • 2,175
  • 10
  • 42
  • 82
  • 1
    chech this - http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-us – npocmaka Feb 09 '15 at 20:04

1 Answers1

0

I got it:

echo TEST.%date:~-4%.%date:~4,2%.%date:~7,2%.%time:~0,2%.%time:~3,2%.%time:~6,2%

and it should give:

TEST.2015.02.09.14.00.35
Angelina
  • 2,175
  • 10
  • 42
  • 82