Holidays

planet-boss
10-02-2001, 09:42 PM
Does anyone know of any site or source for when holidays were and will be from 1/1/1953 to 1/1/2053? I've found a few sites for Easter (enter a year and up pops when Easter was or will be), but have been drawing blanks on all of the other tricky ones. Trying to make up a list of when each of the significant holidays are to put in a text file to load into an array of dates used in a program I'm working on. I don't care if it is a web site, a book you know of, a document that can be ordered or whatever... just need to get the info so I can key in the text file. Maybe there's a function or control somewhere? Any help would be appreciated.

Do I think, therefore, am I?

Squirm
10-03-2001, 10:47 AM
Things such as this are based on algorithms. It would seem a rather sloppy way of doing it to store all those dates. Holidays are set to rules, such as:

*) A specific date (eg Christmas Dec 25th)
*) A set day of the week closest to a date (eg Rememberance Day --> closest Sunday to Nov 11th)

and so on......

I know there are algorithms to work out the day of the week of any date, and so you could just learn the 'rule' for that holiday, then use the algorithm to find the date.

KesleyK
10-03-2001, 10:49 AM
Why not create your own Sub that does this for you? You can use your Weekday, WeekdayName, Date, Day, Month and Year functions to determine whichever holidays you deem important.

__________
HOOOaaaaa! Semper Fi!

planet-boss
10-03-2001, 12:35 PM
I've been putting algorithms together for three days now. The problem is I am trying to get at banking holidays. So Christmas isn't always December 25th. Sometimes it is the 26th. New Years isn't always the first. Sometimes it is on the second. No matter what I do, I end up having a holiday spill somewhere. I have about 20 years of historical data I can compare my routines to. Something always pops out somewhere. Easter is a huge endeavour... it falls somewhere between March 22nd and April 25th. If I could find the rules for the holidays, I would LOVE to put it in algorithms and a sub or my own control. But I think it would be easier to just pop in a look-up table. My program only has to be valid between 1/1/1953 and 1/1/2053.

Do I think, therefore, am I?

Laurent
10-03-2001, 12:46 PM
for the xmas example you could maybe chek if its a saturday or sunday, then check for the next or previous date to get the 24-26... could this work?

I'll be amongst the best any minute now !

planet-boss
10-03-2001, 12:49 PM
I've been trying to do exactly that for three days now. I can't find the rules for determining when the different holidays will be. Mainly, I need to determine banking holidays (but also which holiday). No matter what I do, a few always seem to wiggle out of the algorithm (when I check against a database I have of about 20 years). There's GOT to be a list of rules SOMEWHERE, but I can't seem to find them. You'd think New Years or Christmas would always be on the same day, but they aren't. Sometimes New Years spills over onto the second. And Christmas spills over to the 24th or the 26th. Easter is incredibly difficult to calculate (though I don't need to worry about Easter directly, I do need Good Friday, which depends on Easter). At the very least it seems I need to look-up the Easters from 1953 to 2053. If I'm going to have to do that and have a text file anyway, I might as well just put them all in a text file. I found a source for Easters, but am drawing blanks on the others. I need the rules for New Years, Fourth of July (as in if it is on a Sunday is Monday considered a holiday?), Labor Day, Thanksgiving, Christmas, Presidents Day and Memorial Day. Most of them are pretty straightforward, except 'if it falls on a Sunday does it spill over onto Monday, if it falls on a Saturday does it spill over onto the previous Friday' etc... It never occured to me that dates would be so difficult!

Do I think, therefore, am I?

planet-boss
10-03-2001, 12:58 PM
You know, it's got to work. I could possibly scan my database for Christmas's that fall on Sunday and see if the markets were open the following day, then scan for times it fell on Saturday and see if the markets were open the Friday before. I've found a source for Easter, which is the most impossible one to calculate (I couldn't even follow the explanation of how it is calculated!). It shouldn't take too much work to work out a checklist algorithm to scan the database I have and just do process of elimination. I think I would just write it as its' own program, extrapolate the future from it, then just write it to a text file so my program wouldn't have to scan the database every time it fires up. And so I don't have to write a routine to cover every possible instance.

Do I think, therefore, am I?

KesleyK
10-03-2001, 01:15 PM
Well, that would be a difficult problem indeed. Calculating a holiday is not even *close* to calculating an observed holiday. Banking (or federal sector) may be easier than the private sector (private sector each bargaining unit can modify their observed holidays around their preferred schedule) but I don't know if it is still a "standard" algorithm for all sections of the government.

__________
HOOOaaaaa! Semper Fi!

Squirm
10-03-2001, 02:18 PM
Obviously your holidays work differently to how we have them in the UK. Here, its easy. Whenever there is an event, the following weekend is extended through to Monday. Simple, eh?

KesleyK
10-03-2001, 02:23 PM
That would certainly make it easier to figure out!

__________
HOOOaaaaa! Semper Fi!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum