Hallo Leute,
Ich brauchte einfach mal die Funktion die mir zu jedem beliebigen Datum ab dem Jahre 1 den Tag ausgibt. Ich wollte es hier nur einmal reinstellen falls es jemand Benötigt oda jemand Verbesserungsvorschläge machen will (gibt bestimmt welche)
_DateToDay
MsgBox (0,"",_DateToDay (17,07,2011))
[/autoit] [autoit][/autoit] [autoit]Func _DateToDay ($Day,$Month,$Year)
;Createt by Hendrik Norkowski (Jam00)
;$Day = DD $Month = MM $Year = YYYY
Local $Tage = 1, $i, $1, $MonatsTage, $WDays
$Tage += 365 * ($Year - 0001)
$i = ($Year - Mod ($Year,4)) - 0001
If Mod ($Year,4) = 0 And $Month < 03 Then
$i -= 1
EndIf
For $1 = 4 To $i Step 4
$Tage += 1
Next
$MonatsTage = StringSplit ("31|28|31|30|31|30|31|31|30|31|30|31","|")
For $1 = 1 To $Month - 01
$Tage += $MonatsTage[$1]
Next
$Tage += $Day - 01
While $Tage > 7
$Tage -= 7
WEnd
$WDays = StringSplit ("Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|Sonntag","|")
Return ($WDays[$Tage])
EndFunc
EDIT:
Mir ist noch eine bessere Idee gekommen allerdings weiß ich nicht ob sie geht, werde ich noch ausprobieren