My Holiday Calendar (.ics file generator)
(Another donateWare script from MRE Software)

 

     I was working on a Google Calendar for our ham radio club and wanted to include some holidays on it.  I didn't care for the Google Holiday offerings and really wanted complete control of the holidays and descriptions.  I tried modifying the Google .ics file but found that quite tedious.  I decided to just write my own .ics calendar file generator and add my preferred holidays to it by taking advantage of PHP's great strtotime() function.  I named it My_Holiday_Calendar.php.  I saw many others on the web asking for different holiday calendars so I decided to post it on my site and let others make their own.  It is a little quick and dirty coding and I am no iCal expert but I have commented it pretty well and it worked great for me.  Modify it, run it, and roll your own holiday calendar!

Note1: The first line of the main code sets the default time zone.  You need to edit it for the time zone where you intend to use the calendar.
Some common time zones:
USA Canada Mexico*
Eastern  = "America/New_York"
Central  = "America/Chicago"
Mountain  = "America/Denver"
Mountain (no DST) = "America/Phoenix"
Pacific = "America/Los_Angeles"
Alaska = "America/Anchorage"
Hawaii-Aleutian = "America/Adak"
Hawaii-Aleutian (no DST) = "Pacific/Honolulu"
Puerto Rico = "America/Puerto_Rico"
Guam = "Pacific/Guam"
Newfoundland = "America/St_Johns"
Atlantic = "America/Halifax"
Atlantic (no DST) = "America/Blanc-Sablon "

Eastern = "America/Toronto"
Eastern (no DST) = "America/Atikokan"
Central  = "America/Winnipeg"

Central (no DST) = "America/Regina"
Mountain = "America/Edmonton"
Mountain (no DST) = "America/Whitehorse"

Pacific = "America/Vancouver"
Eastern = "America/Cancun"
Central = "America/Mexico_City"
Mountain = "America/Mazatlan"
Pacific = "America/Tijuana"
---------------------------------------------
* Mexico requires PHP tzdata
version 2022f or newer to work
properly.
Other time zones can be found here: https://www.php.net/manual/en/timezones.php

Note2: The code below contains some Alabama, Mississippi, Georgia, Florida, Louisiana, and Amateur Radio events which you may want to change or remove.

Tip: You can set this up on your web server as a cron job that runs on January 1st, then subscribe to the file it generates (My_Holiday_Calendar.ics) as a URL calendar.  This will keep it updated automatically until the end of the world!  Ask AI how long that is...

Super Tip: How to run this online if you don't have your own PHP interpreter. 
(1.) Copy the PHP code below to your clipboard.
(2.) Now go to: https://www.onlinegdb.com/online_php_interpreter and paste it in the editor.
(3.) Make any needed changes like the time zone and enabling seasons and moons.  You can download the edited file for future use if you like. Download Icon icon.

(4.) Run the code. It will show the generated My_Holiday_Calendar.ics file in a new tab.
(5.) Select the download current file icon. Download Icon
(6.) Save it as My_Holiday_Calendar.ics

This code is for informational purposes only.
USE AT YOUR OWN RISK

 To download a .zip file with the main php file plus an .ics file with the state and ham holidays 
 commented out and with the functions & instructions on adding seasons and full moons:  

ENJOY!

 


An active version of the file this script generates appears below.
It has the seasons and moon options described in the downloadable file enabled.
 

 
 
If you find this code of value, donate a little to the cause.  Think of the time you just saved!
USE AT YOUR OWN RISK!

Feedback on this script is welcomed.

Questions / Comments?  Email me.

MRE Logo