Similar to date command, we have the command time which lets us find the current system time. for /F 'tokens=2' %i in ('date /t') do echo %iĮxample: c:\>for /F 'tokens=2' %i in ('date /t') do echo %i You may want to exclude the day (like ‘Sun’ in the above example) and print only the date in MM/DD/YYYY format. Sun How to get only the date in MM/DD/YYYY format? In addition to date command, we also have an environment variable using which we can find today’s date. Just running date without any arguments prints the current date and then prompts to enter a new date if the user wants to reset it.
To print today’s date on the command prompt, we can run date /t.