Jump to content

Recommended Posts

Posted

You how you always need to check if its easter sunday on a certain date in a couple of years.

ConsoleWrite(_IsEasterSunday(31,3,2013) & @LF); d m yyyy

Func _IsEasterSunday($iday, $imonth, $iyear)

    If $iyear < 1 Or $iyear > 9999 Then
        Return False
        Exit
    EndIf

    $a = Mod($iyear, 19)
    $b = Mod($iyear, 4)
    $c = Mod($iyear, 7)
    $d = Mod(19 * $a + 24, 30)
    $e = Mod(2 * $b + 4 * $c + 6 * $d + 5, 7)
    $sunday = 22 + $d + $e
    $month = 3

    If $sunday > 31 Then
        $month = 4
        $sunday -= 31
    EndIf

    If $iday = $sunday And $imonth = $month Then
        Return True
    Else
        Return False
    EndIf

EndFunc

Sorry ;) I couldnt find on on the forum.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

I find it quite annoying when all these dates keep changing. Didn't they try and change St. Patricks day a year ago. I suppose it's one of those social phenomenons. Still it would be useful to have a varied library of international public holiday dates. It would be pretty useful for international stuff.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...