12-08-2005, 03:46 AM
what is the Calendar forumla? i need to figure out when the 2006 callender is repeted. i dont know where to start
Calendar
|
12-08-2005, 03:46 AM
what is the Calendar forumla? i need to figure out when the 2006 callender is repeted. i dont know where to start
12-08-2005, 03:48 AM
1. Know how many days are in each month
2. know that every month starts the day after the previous 3. know what day january starts on, and the rest fall in place... ^ Infrosoft http://www.thecodeyouneed.us.to/ - A wiki of source code, mostly in PHP and FreeBASIC http://www.osadvocacy.uk.to/ - Your opinion matters no matter your OS
12-21-2005, 11:07 PM
Quote:what is the Calendar forumla? i need to figure out when the 2006 callender is repeted. i dont know where to startWhen you say "when 2006 calendar is repeated", I assume you mean the next year after 2006 which starts on the same day as 2006 (Sunday), and of course is not a leap year --- like 2012 which starts on a Sunday but is a leap year. I don't know of any "formula" that will give you this. Proper programming of dates is a lot of work and involves a lot of testing. I have a date program that I've been using for years. I ran it a few times to find the year when 2006 is repeated, which is 2017. If you'd like the executablee of my date program, post or PM me your email address. *****
12-21-2005, 11:53 PM
12-22-2005, 01:37 AM
This calendar I coded recently has all functions you require.
Hope it helps Code: 'calendar by Antoni Gual 2005
Antoni
12-22-2005, 05:34 AM
Quote:This calendar I coded recently has all functions you require.Congratulations, Antoni. A truly beautiful and precise date program. *****
12-22-2005, 07:32 AM
And about the reuse of the calendar, the calendar FAQ says:
Quote:Let us first assume that you are only interested in which dates fall on which days of the week; you are not interested in the dates for Easter and other irregular holidays.
Antoni
12-23-2005, 07:23 AM
Quote:And about the reuse of the calendar, the calendar FAQ says......The calendar FAQ makes for interesting reading. However, I tested the 2 algorithms in sections 2.13.7 and .8 that it has for the calculation of Easter, and they do not work at all. Since it does not specify, I tried the algorithms using integer, long, and single variable types but could not get the right answers. In some cases Easter was only one day off. In others, the month was correct but the day was a negative number. I hope no one adopts these algorithms into their programs. If you really want a bullet-proof Easter algorithm, see Donald Knuth's book on Fundamental Algorithms. Set all the variables to long, and replace the TEMP MOD 30 with TEMP-30*INT(TEMP/30) because TEMP can be negative and the MOD won't work in Basic. EDIT: Actually there is no TEMP variable in the original. I had to place the expression being "mod'ed" into TEMP to do the above. The calendar FAQ code also uses a MOD 30, but I didn't want to mess around with their code. Maybe the authors of the calendar FAQ did what Knuth once said as a joke: "Beware of bugs in the above code; I have only proved it correct, not tried it." *****
12-23-2005, 03:35 PM
Good to know it...I have never used a formula from that FAQ
For easter i use a snippet i found at the ABC packets, it seems to give good results: Code: DEFINT A-Z
Antoni
12-23-2005, 06:27 PM
Quote:Good to know it...I have never used a formula from that FAQ that is insane. reminds me of agamemnus' code ;P |
« Next Oldest | Next Newest »
|