回复 1# lnlyf
#include <Date.au3>
$year = InputBox('输入年份', '输入年份,例如: 2012', 2012, '')
If $year = '' Or StringLen($year) <> 4 Or Not StringIsDigit($year) Then $year = @YEAR
$mon = InputBox('输入月份', '输月年份,例如: 6', 6, '')
If $mon = '' Or StringLen($mon) > 2 Or StringLen($mon) < 1 Or Not StringIsDigit($mon) Then $mon = @MON
$days = _DateDaysInMonth($year, $mon) ; 返回该年该月份的最大天数
Local $count = 0, $iWeekday
For $i = 1 To $days
$iWeekday = _DateToDayOfWeek($year, $mon, $i)
If $iWeekday = 6 Then $count += 1
If $count = 3 Then
MsgBox(0, '该月第3个星期五', StringFormat('%s-%s-%s', $year, $mon, $i))
ExitLoop
EndIf
Next
|