HOW to find last SUNDAY DATE through batch
问题 How to find 'last SUNDAY DATE' through batch command? what I was trying is echo %date:~4,2%%date:~7,2%%date:~10,4% this is good for current date but for last Sunday date... can anyone suggest any logic through batch. 回答1: Windows PowerShell: [DateTime]::Now.AddDays(-1 * [DateTime]::Now.DayOfWeek.value__) Sorry the environment variable %date% in Batch (.bat) files sounds uneasy to do calculations. 来源: https://stackoverflow.com/questions/33773683/how-to-find-last-sunday-date-through-batch