Calculating future occurrences of Friday the 13th

前端 未结 7 1625
庸人自扰
庸人自扰 2020-12-15 12:48

I\'d like to be able to start with a year, and calculate occurrences of Friday the 13th. A brute force solution is easy and obvious. I have something slightly better, but

相关标签:
7条回答
  • 2020-12-15 13:46

    Here's some example PHP code that goes through a pretty straight forward loop of the dates in a range. I would modify this to check the 13th of each month for Fridayness, rather than checking every Friday for 13thness, as they do in the example.

    0 讨论(0)
提交回复
热议问题