# determining bank holidays = nightmare

• 12-03-2002
rotis23
determining bank holidays = nightmare
what a nightmare!

guess what i have to do.

ok different countries have different bank holidays.

bank holidays fall on different dates each year.

i presume there must be some sort of algorithm to determine when they fall for each country.

does anyone know of a library that does this before i think about writing my own?

TIA, rotis23.
• 12-03-2002
master5001
This doesn't sound very difficult. In fact it sounds easy enough that it is safe to assume that you are not writing bank software (thank god). I know of no such library. However, I do think you could use a calender control (it is an activex control) to help you.
• 12-03-2002
rotis23
no, no banking software.

i'm only using ansi c. (on a linux system).
• 12-03-2002
rotis23
yeah, i thought as much. maybe get the user to determine the dates.

i would have thought that there must be some sort of system for bank holidays. if not who decides?

calender manufacturers must have a nightmare!
any other ideas...

...come on hammer. you know you want to!
• 12-03-2002
Hammer
>come on hammer. you know you want to
Well, echo Salem really

>A text file containing the dates for the next few years would seem to be the easy approach
We have something along that lines here (although on a much more complex scale). Bottom line though, it gets populated by someone with their favourite pocket diary ;)
• 12-03-2002
rotis23
ok, found most of the info (in terms of algorithms) on this website:

http://web-wise-wizard.com/javascrip...-holidays.html

although its in javascript, i'm sure most will understand.

it's quite funny, when he describes 'giving up' trying to implement an algorithm that calculates easter. seems this is when some static data/text file is normally used!
• 12-04-2002
master5001
Though holidays vary from year to year there are actually not that many variations. Although I don't know the actual algorithm that dictates this information it would be easier to hard-code which calendar goes with which year. You can't go wrong with a look up table (at least not for this application). As you can see by looking at the javascript source this program is more tedious than difficult.