Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 581767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:36:53+00:00 2026-05-13T14:36:53+00:00

So, here’s a funny little programming challenge. I was writing a quick method to

  • 0

So, here’s a funny little programming challenge. I was writing a quick method to determine all the market holidays for a particular year, and then I started reading about Easter and discovered just how crazy* the logic is for determining its date–the first Sunday after the Paschal Full Moon following the spring equinox! Does anybody know of an existing function to calculate the date of Easter for a given year?

Granted, it’s probably not all that hard to do; I just figured I’d ask in case somebody’s already done this. (And that seems very likely.)

UPDATE: Actually, I’m really looking for the date of Good Friday (the Friday before Easter)… I just figured Easter would get me there. And since I’m in the U.S., I assume I’m looking for the Catholic Easter? But perhaps someone can correct me on that if I’m wrong.

*By “crazy” I meant, like, involved. Not anything offensive…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:36:54+00:00Added an answer on May 13, 2026 at 2:36 pm

    in SQL Server Easter Sunday would look like this, scroll down for Good Friday

    CREATE FUNCTION dbo.GetEasterSunday 
    ( @Y INT ) 
    RETURNS SMALLDATETIME 
    AS 
    BEGIN 
        DECLARE     @EpactCalc INT,  
            @PaschalDaysCalc INT, 
            @NumOfDaysToSunday INT, 
            @EasterMonth INT, 
            @EasterDay INT 
    
        SET @EpactCalc = (24 + 19 * (@Y % 19)) % 30 
        SET @PaschalDaysCalc = @EpactCalc - (@EpactCalc / 28) 
        SET @NumOfDaysToSunday = @PaschalDaysCalc - ( 
            (@Y + @Y / 4 + @PaschalDaysCalc - 13) % 7 
        ) 
    
        SET @EasterMonth = 3 + (@NumOfDaysToSunday + 40) / 44 
    
        SET @EasterDay = @NumOfDaysToSunday + 28 - ( 
            31 * (@EasterMonth / 4) 
        ) 
    
        RETURN 
        ( 
            SELECT CONVERT 
            (  SMALLDATETIME, 
                     RTRIM(@Y)  
                + RIGHT('0'+RTRIM(@EasterMonth), 2)  
                + RIGHT('0'+RTRIM(@EasterDay), 2)  
            ) 
        ) 
    
    END 
    GO
    

    Good Friday is like this and it uses the Easter function above

    CREATE FUNCTION dbo.GetGoodFriday 
    ( 
        @Y INT 
    ) 
    RETURNS SMALLDATETIME 
    AS 
    BEGIN 
        RETURN (SELECT dbo.GetEasterSunday(@Y) - 2) 
    END 
    GO
    

    From here: http://web.archive.org/web/20070611150639/http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-calendar-table.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the scenario. I'm writing my geo-ruby oracle adapter for Ruby On Rails
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is my program to find all the subsets of given set. To solve
Here is the scenario: I'm writing an app that will watch for any changes
here is my code, SiteMember class @OneToMany(mappedBy = member,cascade=CascadeType.ALL) private List<MemberThread> memberThread = new
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here is my work environment: Eclipse Juno as IDE with maven2 plugin on it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.