How do I can change the output format of echo %date% in command prompt? In one system I receive the output as Wed 02/12/2014 but in another system I receive the output as 02/12/2014. Command I am typing on both the systems is echo %date%.

What I basically need to find out is Day of Week. So if can’t change the format then is there any other command in the command-line to get the Day of week?

有帮助吗?

解决方案

This solution was posted recently and should work the same on any PC after XP Home.

@echo off  
set "daysofweek=Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday"  
for /F "skip=2 tokens=2 delims=," %%a in ('wmic Path Win32_LocalTime Get DayOfWeek /Format:csv') do set "daynumber=%%a"
for /F "tokens=%daynumber% delims=," %%b in ("%daysofweek%") do set "dow=%%b"
echo "%dow%", "%daynumber%"
pause
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top