ConsoleWrite(StringFormat('%02d.%04d\tLast day: %d\n', @MON, @YEAR, _LastDayInMonth()) & @LF)
For $j = @YEAR To @YEAR + 10
For $i = 1 To 13
$iDays = _LastDayInMonth($j, $i)
If @error Then
ConsoleWrite('Error' & @LF)
Else
ConsoleWrite(StringFormat('%02d.%04d\tLast day: %d\n', $i, $j, $iDays))
EndIf
Next
Next
; измененные _DaysInMonth() и _DateIsLeapYear() из Date.au3
Func _LastDayInMonth($i_Year = @YEAR, $i_Mon = @MON)
Local $ai_Days[13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
$i_Year = Abs(Int($i_Year))
If $i_Year < 1000 Or $i_Year > 2999 Then Return SetError(1, 0, 0)
$i_Mon = Abs(Int($i_Mon))
If $i_Mon < 1 Or $i_Mon > 12 Then Return SetError(1, 0, 0)
If (Not Mod($i_Year, 4) And Mod($i_Year, 100)) Or (Not Mod($i_Year, 400)) Then $ai_Days[2] = 29
Return $ai_Days[$i_Mon]
EndFunc ;==>_LastDayInMonth