jave000 当前离线
二级士官
for /f %%k in ('powershell -c get-date -uformat "%%Y.%%m.%%d"') do ( set "Da=%%k" )复制代码
aloha20200628 当前离线
上尉
for /f "tokens=1" %%d in (' powershell "(Get-Date).AddDays(6-(Get-Date -UFormat %u))" ') do set "Da=%%d"&echo,%%d复制代码
for /f "tokens=1" %%d in (' powershell "(Get-Date).AddDays(7+6-(Get-Date -UFormat %u))" ') do set "Da=%%d"&echo,%%d复制代码
TOP
idwma 当前离线
少校
for /f %%k in ('powershell -c "$a=get-date;$a.AddDays(6-[int]$a.DayOfWeek).ToString(\"yyyy.MM.dd\")"') do ( set "Da=%%k" ) echo %Da%复制代码
$a.AddDays(6+7-[int]$a.DayOfWeek)复制代码
ShowCode 当前离线
VIP1
@echo off set "SatDOW=6" for /f %%i in ('powershell -c "Get-Date -UFormat "%%u""') do ( set "TodayDOW=%%i" ) set /a GapDays=SatDOW-TodayDOW for /f %%i in ('powershell -c "Get-Date (Get-Date).AddDays(%GapDays%) -uformat "%%Y-%%m-%%d""') do ( set "SatDate=%%i" ) echo,%SatDate% pause复制代码