不是纯P的,在联盟我曾回复过此类日期的计算贴,本想集中到某个贴子中,只是太忙了....
- @echo off
- >星期计算.vbs Echo aDate = InputBox("请输入一个日期:", "BY: fastslz",date)
- >>星期计算.vbs Echo Wscript.Echo WeekDayName(DatePart("w", aDate))
- for /f "delims=" %%i in ('cscript.exe //nologo 星期计算.vbs') do set aDate=%%i&del 星期计算.vbs
- Echo %aDate%
- pause
复制代码
- @echo off
- >星期计算.vbs Echo a = InputBox("计算昨天请输入-1,明天输入1,后天输入2,以此类推:", "BY: fastslz")
- >>星期计算.vbs Echo aDate=FormatDateTime (DateAdd("d", a ,Date),2)
- >>星期计算.vbs Echo Wscript.Echo WeekDayName(DatePart("w", aDate))
- for /f "delims=" %%i in ('cscript.exe //nologo 星期计算.vbs') do set aDate=%%i&del 星期计算.vbs
- Echo %aDate%
- pause
复制代码
-
- @echo off
- >周计算.vbs Echo aDate = InputBox("请输入一个日期:", "BY: fastslz",date)
- >>周计算.vbs Echo Wscript.Echo "0" ^&Right(Year(aDate) ,1)^&"年" ^& DatePart("ww", aDate)^&"周"
- for /f "delims=" %%i in ('cscript.exe //nologo 周计算.vbs') do set aDate=%%i&del 周计算.vbs
- Echo %aDate%
- pause
复制代码
-
- @echo off
- >天计算.vbs Echo aDate = InputBox("请输入一个日期:", "BY: fastslz",date)
- >>天计算.vbs Echo Wscript.Echo Year(aDate) ^&"年第" ^& DatePart("y", aDate) ^& "天"
- for /f "delims=" %%i in ('cscript.exe //nologo 天计算.vbs') do set aDate=%%i&del 天计算.vbs
- Echo %aDate%
- pause
复制代码
|