Thread: determining bank holidays = nightmare

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    351

    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.

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    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.

  3. #3
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    no, no banking software.

    i'm only using ansi c. (on a linux system).

  4. #4
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    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!

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >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
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  6. #6
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    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!

  7. #7
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bank Account Problem
    By JayBlay77 in forum C++ Programming
    Replies: 1
    Last Post: 03-19-2009, 08:41 AM
  2. helppp in bank databse
    By neha007 in forum C++ Programming
    Replies: 1
    Last Post: 06-02-2007, 09:43 AM
  3. Replies: 12
    Last Post: 06-03-2005, 01:13 AM
  4. Bank Account
    By vasanth in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 09-14-2003, 02:27 AM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM