How Holiday Dates Are Formatted in MyPhoneExplorer Holiday Files
Updated
MyPhoneExplorer holiday files use one line per holiday, with three pipe-separated fields: Name|OfficialFlag|DateValue. The date value combines a required base date (fixed day/month, Easter-based codes, or a full date) with two optional space-separated modifiers: a day offset and a weekday constraint. For example, New Years Day|1|0101 is a fixed date, while Martin Luther King Day|1|0101 +3 MO means the third Monday in January.
The Line Structure
Each line in a *.dat holiday file represents one holiday and has three values separated by the | character:
| Position | Meaning | Values |
|---|---|---|
| 1st | Name of the holiday | Free text |
| 2nd | Official holiday flag | 1 = official holiday (markets are closed), 0 = other holiday |
| 3rd | Date value | Base date plus optional modifiers |
Base Date Formats
The first part of the date value is required and can take several forms:
0101— a fixed day and month (1st January), valid every year0507— 5th JulyES— Easter SundayEES— Easter Sunday in the Orthodox (eastern) church03052006— a full date (3rd May 2006). Note that in this format the holiday is only parsed for the given year; it is intended only for special holidays that cannot be calculated any other way.
Optional Modifiers
After the base date, up to two optional values can follow, separated by spaces.
Day counter offset
The second value shifts the date by a number of days relative to the base date. For example, Easter Monday is ES +1 (one day after Easter Sunday), and Ash Wednesday is ES -46 (46 days before Easter Sunday).
Weekday constraint
The third value pins the holiday to a specific weekday using these strings: MO, TU, WE, TH, FR, SA, SU. Combined with the offset, this expresses rules like "the second Sunday in May" (0105 +2 SU) or "the last Monday in November" (3011 -1 MO).
Worked Examples
| Holiday | Line | Reading |
|---|---|---|
| New Years Day | New Years Day|1|0101 |
Fixed 1st January |
| Ash Wednesday | Ash Wednesday|0|ES -46 |
46 days before Easter Sunday |
| Martin Luther King Day | Martin Luther King Day|1|0101 +3 MO |
Third Monday in January |
Creating and Using the File
- Open an existing holiday file with Notepad to see the structure, or create a new text file.
- Add one line per holiday using the format above.
- Save the file with the
*.datextension, named after your country, in the holiday folder (usuallyC:\Programs\MyPhoneExplorer\holidays). - Select your holiday file in the options dialog of MyPhoneExplorer.
The page author asks that contributed files be checked against a few years of calendars before being sent in for inclusion in future versions. If a holiday in your country cannot be expressed with these date values, the author invites you to contact him so a calculation method can be found.