Need to format the current date to YYYYMMDD
Posted on 2011-09-23
I have a batch file that is going to be called automatically. It looks for a file that will have the current date as part of the file name. I need a DOS script that can take the current date, transform it to the format YYYYMMDD and then append that to the base of the file name in order to process the file. As an example, the base of the file name is ABC- so the script needs to get the current date and append it as follows:
I have been trouble finding information on how to do that.
Thanks for your help.