给定一年,我如何计算天主教受难日是哪一天?
有没有人有一个好的算法来计算给定年份作为输入的耶稣受难日是哪一天?最好是 C# 语言。
Does anyone have a good algorithm to calculate what date Good Friday falls on given the year as an input? Preferably in C#.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这是一篇很棒的文章,可以帮助您构建算法
http://www.codeproject.com/ KB/datetime/christianholidays.aspx
根据此示例,您应该能够编写:
完整示例:
Here's a great article that should help you build your algorithm
http://www.codeproject.com/KB/datetime/christianholidays.aspx
Based on this example, you should be able to write:
Full Example:
不要重复自己
思考
意识到计算复活节才是你真正依赖的。
研究
这是计算复活节的官方海军天文台页面。
https:// web.archive.org/web/20120223154950/https://aa.usno.navy.mil/faq/docs/easter.php
执行
使用计算复活节的公式,然后转到上周五(或减去 2 天,具体细节由您决定)。
Don't Repeat Yourself
Think
Realize that calculating Easter is what you are really dependent upon.
Research
Here is the offical Naval Observatory page for calculating Easter.
https://web.archive.org/web/20120223154950/https://aa.usno.navy.mil/faq/docs/easter.php
Execute
Use the formula for calculating Easter then shift to the previous Friday (or subtract 2 days, details up to you).
试试这个:
从这里移植的逻辑: http://www.kenhamady.com/form25.shtml
Try this:
Logic ported from here: http://www.kenhamady.com/form25.shtml
维基百科知道:http://en.wikipedia.org/wiki/Good_Friday#Calculate_the_date
Wikipedia knows: http://en.wikipedia.org/wiki/Good_Friday#Calculating_the_date
死灵术。
实际上,这取决于是东正教还是天主教的耶稣受难日;
)
https://mycodepad.wordpress.com /2013/04/28/c-calculate-orthodox-and-catholic-easter/
(注意:复活节 = 复活节星期日)
那么你仍然可以创建一个抽象的 EasterBunny:
用这个抽象的兔子:
Necromancing.
Actually, it depends on whether it is Orthodox or Catholic Good Friday ;)
from
https://mycodepad.wordpress.com/2013/04/28/c-calculating-orthodox-and-catholic-easter/
(Note: Easter = Easter Sunday)
Then you could still create an abstract EasterBunny:
With this abstract bunny here:
是否可以使用希伯来阴历或阿拉伯阴历进行转换?
例如:
Is it possible to the use the Hebrew or Arabic lunar calendars for the conversion?
eg: