by Jason Butera (2 Submissions)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (6 Votes)
This code module consists of 2 functions that will answer the following questions:
- Is 05/25/2020 a federal holiday?
- What date is the 3rd Tuesday in January of 2010?
Many holidays are not on a specific date. Memorial Day, for example, is on the last Monday of May. Many other federal holidays follow rules like this (MLK, Thanksgiving, Labor Day, etc...). This code looks for all federal holidays (specific dates and floating dates). You can modify the code to include or remove other holidays.
Our system could not have due dates that fall on a holiday, so I wrote this code and I'm sharing it with you. The included form that uses the code is just an example (no error trapping). If you like and use this module, please vote for me with a kind word. Cheers!
Inputs
GetDateByOccurrence(Year,Month,Weekday,Occurrence)
IsHoliday(Date)
Code Returns
GetDateByOccurrence(): Variant (Date or String)
IsHoliday(): Boolean
Side Effects
None Known
Download Find Floating Holidays and nth Weekday of any Month and Year (3 KB)