Tech Support Guy banner
Status
Not open for further replies.

date format in script

850 views 2 replies 3 participants last post by  mpnut 
#1 ·
hello,
I want to format date in my batch script so that I may use it as file name.How can I format date from default formatting to dd/mm/yy ?
 
#3 ·
It's been a couple days so you may have already found your solution, but here's another way to name a file with the date you want. You aren't going to want "/" in the filename so you should probably use something like underscores "_". Here's how to rename a file with the date mm_dd_yy:

REN filename.txt %DATE:~4,2%_%DATE:~7,2%_%DATE:~12,2%.txt

Hope this helps.
 
Status
Not open for further replies.
You have insufficient privileges to reply here.
Top