Database of Actual Federal Holidays / Closure - language-agnostic

I am working on a coding problem and I need to check whether a past date was a federal holiday. It is trivial and I have already pulled the historic planned holidays but there have been many federal holidays/non-working days that have been declared by Presidential Proclamation or Executive Order. These include the day before(or) after Christmas as was done last year, the day of mourning for Former President Ford and snow emergency days that affected federal operations in DC.
So the question is, does anyone know where there is a listing of these that can be counted upon to be reasonably comprehensive. The only things I can find are lists of the statutory holidays.
Thanks

I took the time to compile the dates from the OPM website and thought I would share them here. Hopefully this list will save someone else a bit of time in the future. Dates are in a standard US date format (mm/dd/yyyy); they are US holidays, after all. The list currently contains dates from 1997 through 2020.
01/01/1997 New Year’s Day
01/20/1997 Birthday of Martin Luther King, Jr.
02/17/1997 Washington’s Birthday
05/26/1997 Memorial Day
07/04/1997 Independence Day
09/01/1997 Labor Day
10/13/1997 Columbus Day
11/11/1997 Veterans Day
11/27/1997 Thanksgiving Day
12/25/1997 Christmas Day
01/01/1998 New Year’s Day
01/19/1998 Birthday of Martin Luther King, Jr.
02/16/1998 Washington’s Birthday
05/25/1998 Memorial Day
07/03/1998 Independence Day
09/07/1998 Labor Day
10/12/1998 Columbus Day
11/11/1998 Veterans Day
11/26/1998 Thanksgiving Day
12/25/1998 Christmas Day
01/01/1999 New Year’s Day
01/18/1999 Birthday of Martin Luther King, Jr.
02/15/1999 Washington’s Birthday
05/31/1999 Memorial Day
07/05/1999 Independence Day
09/06/1999 Labor Day
10/11/1999 Columbus Day
11/11/1999 Veterans Day
11/25/1999 Thanksgiving Day
12/24/1999 Christmas Day
12/31/1999 New Year’s Day
01/17/2000 Birthday of Martin Luther King, Jr.
02/21/2000 Washington’s Birthday
05/29/2000 Memorial Day
07/04/2000 Independence Day
09/04/2000 Labor Day
10/09/2000 Columbus Day
11/10/2000 Veterans Day
11/23/2000 Thanksgiving Day
12/25/2000 Christmas Day
01/01/2001 New Year’s Day
01/15/2001 Birthday of Martin Luther King, Jr.
02/19/2001 Washington’s Birthday
05/28/2001 Memorial Day
07/04/2001 Independence Day
09/03/2001 Labor Day
10/08/2001 Columbus Day
11/12/2001 Veterans Day
11/22/2001 Thanksgiving Day
12/25/2001 Christmas Day
01/01/2002 New Year’s Day
01/21/2002 Birthday of Martin Luther King, Jr.
02/18/2002 Washington’s Birthday
05/27/2002 Memorial Day
07/04/2002 Independence Day
09/02/2002 Labor Day
10/14/2002 Columbus Day
11/11/2002 Veterans Day
11/28/2002 Thanksgiving Day
12/25/2002 Christmas Day
01/01/2003 New Year’s Day
01/20/2003 Birthday of Martin Luther King, Jr.
02/17/2003 Washington’s Birthday
05/26/2003 Memorial Day
07/04/2003 Independence Day
09/01/2003 Labor Day
10/13/2003 Columbus Day
11/11/2003 Veterans Day
11/27/2003 Thanksgiving Day
12/25/2003 Christmas Day
01/01/2004 New Year's Day
01/19/2004 Birthday of Martin Luther King, Jr.
02/16/2004 Washington's Birthday
05/31/2004 Memorial Day
07/05/2004 Independence Day
09/06/2004 Labor Day
10/11/2004 Columbus Day
11/11/2004 Veterans Day
11/25/2004 Thanksgiving Day
12/24/2004 Christmas Day
12/31/2004 New Year’s Day
01/17/2005 Birthday of Martin Luther King, Jr.
02/21/2005 Washington’s Birthday
05/30/2005 Memorial Day
07/04/2005 Independence Day
09/05/2005 Labor Day
10/10/2005 Columbus Day
11/11/2005 Veterans Day
11/24/2005 Thanksgiving Day
12/26/2005 Christmas Day
01/02/2006 New Year’s Day
01/16/2006 Birthday of Martin Luther King, Jr.
02/20/2006 Washington’s Birthday
05/29/2006 Memorial Day
07/04/2006 Independence Day
09/04/2006 Labor Day
10/09/2006 Columbus Day
11/10/2006 Veterans Day
11/23/2006 Thanksgiving Day
12/25/2006 Christmas Day
01/01/2007 New Year’s Day
01/15/2007 Birthday of Martin Luther King, Jr.
02/19/2007 Washington’s Birthday
05/28/2007 Memorial Day
07/04/2007 Independence Day
09/03/2007 Labor Day
10/08/2007 Columbus Day
11/12/2007 Veterans Day
11/22/2007 Thanksgiving Day
12/25/2007 Christmas Day
01/01/2008 New Year’s Day
01/21/2008 Birthday of Martin Luther King, Jr.
02/18/2008 Washington’s Birthday
05/26/2008 Memorial Day
07/04/2008 Independence Day
09/01/2008 Labor Day
10/13/2008 Columbus Day
11/11/2008 Veterans Day
11/27/2008 Thanksgiving Day
12/25/2008 Christmas Day
01/01/2009 New Year’s Day
01/19/2009 Birthday of Martin Luther King, Jr.
02/16/2009 Washington’s Birthday
05/25/2009 Memorial Day
07/03/2009 Independence Day
09/07/2009 Labor Day
10/12/2009 Columbus Day
11/11/2009 Veterans Day
11/26/2009 Thanksgiving Day
12/25/2009 Christmas Day
01/01/2010 New Year’s Day
01/18/2010 Birthday of Martin Luther King, Jr.
02/15/2010 Washington’s Birthday
05/31/2010 Memorial Day
07/05/2010 Independence Day
09/06/2010 Labor Day
10/11/2010 Columbus Day
11/11/2010 Veterans Day
11/25/2010 Thanksgiving Day
12/24/2010 Christmas Day
12/31/2010 New Year’s Day
01/17/2011 Birthday of Martin Luther King, Jr.
02/21/2011 Washington’s Birthday
05/30/2011 Memorial Day
07/04/2011 Independence Day
09/05/2011 Labor Day
10/10/2011 Columbus Day
11/11/2011 Veterans Day
11/24/2011 Thanksgiving Day
12/26/2011 Christmas Day
01/02/2012 New Year's Day
01/16/2012 Birthday of Martin Luther King, Jr.
02/20/2012 Washington's Birthday
05/28/2012 Memorial Day
07/04/2012 Independence Day
09/03/2012 Labor Day
10/08/2012 Columbus Day
11/12/2012 Veterans Day
11/22/2012 Thanksgiving Day
12/25/2012 Christmas Day
01/01/2013 New Year’s Day
01/21/2013 Birthday of Martin Luther King, Jr.
02/18/2013 Washington’s Birthday
05/27/2013 Memorial Day
07/04/2013 Independence Day
09/02/2013 Labor Day
10/14/2013 Columbus Day
11/11/2013 Veterans Day
11/28/2013 Thanksgiving Day
12/25/2013 Christmas Day
01/01/2014 New Year’s Day
01/20/2014 Birthday of Martin Luther King, Jr.
02/17/2014 Washington’s Birthday
05/26/2014 Memorial Day
07/04/2014 Independence Day
09/01/2014 Labor Day
10/13/2014 Columbus Day
11/11/2014 Veterans Day
11/27/2014 Thanksgiving Day
12/25/2014 Christmas Day
01/01/2015 New Year’s Day
01/19/2015 Birthday of Martin Luther King, Jr.
02/16/2015 Washington’s Birthday
05/25/2015 Memorial Day
07/03/2015 Independence Day
09/07/2015 Labor Day
10/12/2015 Columbus Day
11/11/2015 Veterans Day
11/26/2015 Thanksgiving Day
12/25/2015 Christmas Day
01/01/2016 New Year’s Day
01/18/2016 Birthday of Martin Luther King, Jr.
02/15/2016 Washington’s Birthday
05/30/2016 Memorial Day
07/04/2016 Independence Day
09/05/2016 Labor Day
10/10/2016 Columbus Day
11/11/2016 Veterans Day
11/24/2016 Thanksgiving Day
12/26/2016 Christmas Day
01/02/2017 New Year’s Day
01/16/2017 Birthday of Martin Luther King, Jr.
02/20/2017 Washington’s Birthday
05/29/2017 Memorial Day
07/04/2017 Independence Day
09/04/2017 Labor Day
10/09/2017 Columbus Day
11/10/2017 Veterans Day
11/23/2017 Thanksgiving Day
12/25/2017 Christmas Day
01/01/2018 New Year’s Day
01/15/2018 Birthday of Martin Luther King, Jr.
02/19/2018 Washington’s Birthday
05/28/2018 Memorial Day
07/04/2018 Independence Day
09/03/2018 Labor Day
10/08/2018 Columbus Day
11/12/2018 Veterans Day
11/22/2018 Thanksgiving Day
12/25/2018 Christmas Day
01/01/2019 New Year’s Day
01/21/2019 Birthday of Martin Luther King, Jr.
02/18/2019 Washington’s Birthday
05/27/2019 Memorial Day
07/04/2019 Independence Day
09/02/2019 Labor Day
10/14/2019 Columbus Day
11/11/2019 Veterans Day
11/28/2019 Thanksgiving Day
12/25/2019 Christmas Day
01/01/2020 New Year’s Day
01/20/2020 Birthday of Martin Luther King, Jr.
02/17/2020 Washington’s Birthday
05/25/2020 Memorial Day
07/03/2020 Independence Day
09/07/2020 Labor Day
10/12/2020 Columbus Day
11/11/2020 Veterans Day
11/26/2020 Thanksgiving Day
12/25/2020 Christmas Day

The best I know of is
http://www.opm.gov/Operating_Status_Schedules/fedhol/2010.asp
You can replace the year with any year between 1997 and 2020.
Cheers
Stu

Related

SQL Code to get Week Number when week begins Sunday to Saturday

My company’s week begins on a Sunday.
The issue I’m having is extracting the week number from the date in the database.
For example,02/01/2022 falls in week 52 of 2021 using the Sunday week beginning logic. How can I write a SQL code to give me :
a) the week number (I.e 2nd Jan 2022 is part of week 52)
b) the correct year of the week. i.e 2nd Jan 2022 , I want it to bring back the year “2021” so my data set is complete and accurate.
N.b.
Database name I’m using is dw-fin and column of the date is called date-created
You can use the WEEK function with a 'mode'.
Which is an integer indicating the starting of the week.
And the YEARWEEK function also has a mode.
Mode
First day of week
Range
Week 1 is the first week
0
Sunday
0-53
with a Sunday in this year
1
Monday
0-53
with 4 or more days this year
2
Sunday
1-53
with a Sunday in this year
3
Monday
1-53
with 4 or more days this year
4
Sunday
0-53
with 4 or more days this year
5
Monday
0-53
with a Monday in this year
6
Sunday
1-53
with 4 or more days this year
7
Monday
1-53
with a Monday in this year
Example :
select date_column
, month(date_column) as month
, year(date_column) as year
, yearweek(date_column, 2) as mode2_yearweek
, floor(yearweek(date_column, 2)/100) as mode2_year
, week(date_column, 2) as mode2_week
from (select date('2022-01-01') as date_column) q;
date_column
month
year
mode2_yearweek
mode2_year
mode2_week
2022-01-01
1
2022
202152
2021
52
Demo on db<>fiddle here

Identifying dates from datespan for multiple entries

I need your guidance in regard to a query I am trying to write, but hitting a wall on. I am working on a project for a scheduling system. The scheduling system has in it a dates calendar table, a yearsemester table with datespans, a courses table with courses assigned to yearsemesters, and a components table with the course components (days of week & times) listed.
I need to write a query that identifies every day of the week within a given datesspan (parameters), from a web form, where a class takes place.
These tables approximately look like the example below:
(Dates) Calendar Table:
Date
DayofWeek
2021-01-01
Friday
2021-01-02
Saturday
2021-01-03
Sunday
.... On and on for like 20 years worth of dates
(YearSemester) table:
ID
Year
Semster
Start Date
End Date
1
2021
Spring
2021-01-04
2021-05-01
2
2021
Summer
2021-06-01
2021-08-15
3
2021
Fall
2021-08-15
2021-12-30
(CoursesSchedule) table:
ID
YearSemesterID
CourseID
1
1
CTI120
2
1
DBA110
3
1
DBA225
(ComponentSchedule) table:
ID
CourseScheduleID
Component
DayofWeek
Start Time
End Time
1
1
Class
Monday
8:00 AM
10:00 AM
2
1
lab
Monday
11:00 AM
11:50 AM
3
1
Class
Wednesday
8:00 AM
10:00 AM
4
1
Lab
Wednesday
11:00 AM
11:50 AM
5
2
Class
Tuesday
5:00 PM
9:00 PM
6
2
Class
Thursday
5:00 PM
9:00 PM
7
3
Class
Monday
1:00 PM
3:00 PM
8
3
Class
Friday
1:00 PM
3:00 PM
I need to find a way using either the calendars table, or some other method, to generate a result set like the following when given start and end dates as parameters from a web form
INTENDED QUERY OUTPUT
YEAR
SEMESTER
COURSE
COMPONENT
DATE
Start Time
End Time
2021
SPRING
CTI110
CLASS
2021-01-04
8:00 AM
10:00 AM
2021
SPRING
CTI110
LAB
2021-01-04
8:00 AM
10:00 AM
2021
SPRING
DBA225
CLASS
2021-01-04
1:00 PM
3:00 PM
2021
SPRING
DBA110
CLASS
2021-01-05
5:00 PM
9:00 PM
2021
SPRING
CTI110
CLASS
2021-01-06
8:00 AM
10:00 AM
2021
SPRING
CTI110
LAB
2021-01-06
8:00 AM
10:00 AM
... And so on and so forth to the end of the date span. This is to be displayed on the webpage, and used in a calendar view eventually, with some formatting of course.
I can't figure out how to generate the individual dates of occurrence by referencing the semester's date span against the course's component days of the week. Should this be a loop?
Any advice, or guidance, if you have a good guide on a topic such as this, would be greatly appreciated!! I haven't been able to find anything super helpful so far.

How do I copy and paste essays and informations to put onto my HTML page?

Something like this to actually appear on my page.
DECEMBER 1
World AIDS Day
National Pie Day
National Eat a Red Apple Day
Bifocals at the Monitor Liberation Day
Day With(out) Art Day
Rosa Parks Day
DECEMBER 2
International Day for the Abolition of Slavery
National Fritters Day
National Mutt Day
Special Education Day #SpecialEducationDay
Rockefeller Center Tree Lighting – Changes Annually
Faux Fur Friday – First Friday in December
DECEMBER 3
International Day of Persons with Disabilities
Roof Over Your Head Day #RoofOverYourHeadDay
National Rhubarb Vodka Day – First Saturday in December
Skywarn Recognition Day – First Saturday in December
DECEMBER 4
National Cookie Day
National Dice Day
DECEMBER 5
World Soil Day
International Volunteer Day for Economic and Social Development
National Sacher Torte Day
AFL-CIO Day
Bathtub Party Day
International Ninja Day
Repeal Day #RepealDay
DECEMBER 6
National Pawnbrokers Day
National Microwave Oven Day
National Gazpacho Day
St. Nicholas Day
Miners’ Day
DECEMBER 7
International Civil Aviation Day
National Pearl Harbor Remembrance Day
National Cotton Candy Day
DECEMBER 8
National Brownie Day
Pretend to Be a Time Traveler Day #PretendToBeATimeTravelerDay
DECEMBER 9
International Anti-Corruption Day
National Pastry Day
Weary Willie Day
DECEMBER 10
Dewey Decimal System Day
Human Rights Day
Nobel Prize Day
National Wreaths Across America Day – Second Saturday in December
DECEMBER 11
International Mountain Day
National Noodle Ring Day
UNICEF Birthday
DECEMBER 12
#MavenTheCorgi’s Birthday
National Ambrosia Day
National Ding-a-Ling Day
Gingerbread House Day
Poinsettia Day
DECEMBER 13
National Cocoa Day
National Violin Day
National Day Of The Horse (Senate Res. 452)
Pick a Pathologist Pal Day
Instead of something like this.
DECEMBER 1 World AIDS Day National Pie Day National Eat a Red Apple Day Bifocals at the Monitor Liberation Day Day With(out) Art Day Rosa Parks Day
DECEMBER 2 International Day for the Abolition of Slavery National Fritters Day National Mutt Day Special Education Day #SpecialEducationDay Rockefeller Center Tree Lighting – Changes Annually Faux Fur Friday – First Friday in December DECEMBER 3
Much help would be appreciated thanks!!
After further searching I think I have the solution you need.
Use the "pre" tag and you will get the result you want.
Example:
<pre>
This will be presented in the browser
just like I write it here.
</pre>
You can also see this example: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_pre
I hope this answer is good enough.

week number returns previous year last week number for january fist week in mysql

I am facing one issue while fetching the week number for 2016-01-01(fist week) in mysql. it return 53 if i use week() function or weekofyear() function . I have to get as 1 since I am linking the weeknumber in my project in other places and if it returns 1 the next week number also should be adjusted according to that. Kindly any one help me on this.
The manual says:
If the week containing January 1 has 4 or more days in the new year,
it is week 1.
Otherwise, it is the last week of the previous year, and the next week
is week 1.
So you can provide the mode to the week function.
Mode First day of week Range Week 1 is the first week …
0 Sunday 0-53 with a Sunday in this year
1 Monday 0-53 with 4 or more days this year
2 Sunday 1-53 with a Sunday in this year
3 Monday 1-53 with 4 or more days this year
4 Sunday 0-53 with 4 or more days this year
5 Monday 0-53 with a Monday in this year
6 Sunday 1-53 with 4 or more days this year
7 Monday 1-53 with a Monday in this year
Something like this:
select WEEK('2016-01-01',0) + 1;
FIDDLE DEMO

MySQL get next 3 months of holidays by month, day (regardless of year)

I have a table of holidays, stored by date, so they have a year:
Christmas 2014-12-25
Birthday 2014-05-12
Holiday 3 2015-11-27
Let's say today is November 1st, in the year 2020. How do I retrieve the holidays for the next three months, in order of month, day occurrence? So the record set should look like:
Holiday 3 2015-11-27
Christmas 2014-12-25
EDIT: If I modified the table to include the months and dates in separate columns, a suggested by PressingOnAlways below, how could I query for the date range?
Holiday Year Month Date
Christmas 2014 12 25
Birthday 2014 05 12
Holiday 3 2015 11 27
You can select holidays using DAY() and MONTH() methods of SQL
In your where clause use DAY(holiday) AND MONTH(holiday)
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_day
http://www.sqlfiddle.com/#!2/92c97/15