{
    "mode": "info",
    "parameter": "Date::Manip::Holidays",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/Date%3A%3AManip%3A%3AHolidays/json",
    "generated": "2026-07-05T13:53:19Z",
    "synopsis": "This describes the Holidays and Events sections of the config file, and\nhow they are used.\nHolidays and events are specific days that are named. Holidays are used\nin business mode calculations, events are not. Events may be used for\nother calendaring operations.",
    "sections": {
        "Date::Manip::Holidays(User Contributed Perl DocumentDate::Manip::Holidays(3pm)": {
            "content": "",
            "subsections": []
        },
        "NAME": {
            "content": "Date::Manip::Holidays - describes holidays and events\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "This describes the Holidays and Events sections of the config file, and\nhow they are used.\n\nHolidays and events are specific days that are named. Holidays are used\nin business mode calculations, events are not. Events may be used for\nother calendaring operations.\n",
            "subsections": []
        },
        "HOLIDAYS": {
            "content": "The holiday section of the config file is used to define holidays.\nEach line is of the form:\n\nSTRING = HOLIDAY\n\nHOLIDAY is the name of the holiday or it can be blank.\n\nIf HOLIDAY is blank, the holiday is unnamed, but still treated as a\nholiday.  For example, in the US, the day after Thanksgiving is often a\nwork holiday though it is not named.\n\nHOLIDAY should be unique in most cases.  The only exception is if the\nholiday definition is complex enough that it is impossible to describe\nit with one STRING.  In this case, multiple lines may be given with\ndifferent values of STRING but the same value for HOLIDAY, and in these\ncases, the first STRING that matches a given year will be used.  This\nsituation is described in more detail below.\n\nNOTE: It is not allowed to have unnamed holidays that require multiple\ndefinitions, so a name will have to be assigned in that case.\n\nSTRING is a string which can be parsed to give a valid date. It can be\nany of the following forms:\n\nA full date\nSpecific holidays can be set which occur only a single time.\n\nMay 5, 2000                     = A one-time-only holiday\n\nAny format parseable by \"Date::Manip::Date::parsedate\" can be\nused.\n\nThere is one caveat to using a full date.  Date::Manip assumes that\nmost holidays will appear once per year, so if you were to\nexplicitly defined New Years (observed) as:\n\n2004-12-31                      = New Year's Day\n\nthen it would assume that it had found the occurrence of New Year's\nfor 2004 when in fact, this is the 2005 occurrence.\n\nFull date specifications should only be used as a last resort, and\nprobably only if you will explicitly specify all occurrence of the\nholiday.\n\nA date without a year\nSome holidays occur every year on the same day. These can be\ndefined using the simple lines:\n\nJan 1                           = New Year's Day\nJul 4th                         = Independence Day\nfourth Thu in Nov               = Thanksgiving\n\nThese dates must be written in a form which can be parsed as a full\ndate by simply adding the year to the end of the string. Please\nrefer to the Date::Manip::Date documentation to see what forms will\nwork. ISO 8601 dates will not work since the year comes first.\n\nAny format parseable by \"Date::Manip::Date::parsedate\" which\nallows the year to be at the end can be used.\n\nRecurrence\nThe dates can be specified using recurrences:\n\n1*0:0:0:0:0:0*EASTER            = Easter\n1*11:0:11:0:0:0*DWD             = Veteran's Day\n1*11:4:4:0:0:0                  = Thanksgiving\n1*11:4:4:0:0:0*FD1              = Day after Thanksgiving\n\nIn cases where you are interested in business type calculations,\nyou'll want to define most holidays using recurrences, since they\ncan define when a holiday is celebrated in the financial world.\nFor example, Christmas might be defined as:\n\nDec 25               = Christmas\n\nbut if it falls on a weekend, there won't be a business holiday\nassociated with it. It could be defined using a recurrence:\n\n1*12:0:24:0:0:0*DWD  = Christmas\n\nso that if Christmas falls on a weekend, a holiday will be taken on\nthe Friday before or the Monday after the weekend.\n\nYou can use the fully specified format of a recurrence:\n\n1*2:0:1:0:0:0*Jan 1 1999*Dec 31 2002 = Feb 2 from 1999-2002\n",
            "subsections": []
        },
        "OTHER HOLIDAY CONSIDERATIONS": {
            "content": "Recurrences which change years\nIt is now valid to have a recurrence defined for New Year's day\nwhich pushes the holiday to the previous year.\n\nFor example, the most useful definition of New Year's day is:\n\n1*1:0:1:0:0:0*DWD               = New Year's Day\n\nwhich means to choose the closest working day to observe the\nholiday, even though this might mean that the holiday is observed\non the previous year.\n\nOrder of definitions is preserved\nThe order of the definitions is preserved. In other words, when\nlooking at the holidays for a year, previously defined holidays (in\nthe order given in the config file) are correctly handled.\n\nAs an example, if you wanted to define both Christmas and Boxing\ndays (Boxing is the day after Christmas, and is celebrated in some\nparts of the world), and you wanted to celebrate Christmas on a\nbusiness day on or after Dec 25, and Boxing day as the following\nwork day, you could do it in one of the following ways:\n\n1*12:0:25:0:0:0*NWD  = Christmas\n1*12:0:26:0:0:0*NWD  = Boxing\n\nor\n\n1*12:0:25:0:0:0*NWD  = Christmas\n1*12:0:25:0:0:0*NWD  = Boxing\n\nHolidays go into affect the minute they are parsed which is why the\nsecond example works (though for clarity, the first one is\npreferable).  The first recurrence defined the first business day\non or after Dec 25 as Christmas.  The second one then defines the\nbusiness day after that as Boxing day.  Since the definitions are\nstored as a list (NOT a hash as they were in Date::Manip 5.xx),\nusing the same recurrence twice does not cause a problem.\n\nMultiple holidays\nHaving multiple holidays on a single day is allowed. As an example,\nyou may want to look at New Years day as both the observed and\nactual holidays, so you might have:\n\n1*1:0:1:0:0:0*DWD               = New Year's Day (observed)\nJan 1                           = New Year's Day\n\nMost of the time, both will fall on the same day, but sometimes\nthey may differ.  In this example, it is important that the\nobserved holiday be listed first.  Otherwise, Jan 1 will be marked\nas a holiday and then the observed date will check Jan 1, but where\nit is not a business day, it will move to another day (due to the\nDWD modifier).\n\nLikewise, the two holidays:\n\n3rd Sunday in June              = Father's Day\nJun 17                          = Bunker Hill Day\n\nsometimes fall on the same day.  Using the\n\"Date::Manip::Date::listholidays\" method (or the \"DateIsHoliday\"\nfunction), you can get a list of all names that the date contains.\n\nComplex holiday descriptions\nOccasionally, you cannot describe a holiday using a single line.\nFor example, the US Federal Reserve banks use a complex holiday\ndescription where:\n\nFor holidays falling on Saturday, Federal Reserve Banks\nand Branches will be open the preceding Friday. For holidays\nfalling on Sunday, all Federal Reserve Banks and Branches\nwill be closed the following Monday.\n\nSince Saturday is not a business day, the DWD modifier will not\nwork.  For these, you need a more complicated definition.\n\nThe following definitions both work:\n\n# Saturday\n1*1:0:1:0:0:0*NBD,BD1,IBD,FD1   = New Year's Day\n# Sunday (observed Monday)\n1*1:0:1:0:0:0*NBD,BD1,NBD,FD2   = New Year's Day\n# M-F\n1*1:0:1:0:0:0*IBD               = New Year's Day\n\nand\n\n# Saturday\n1*1:0:1:0:0:0*IW6               = New Year's Day\n# Sunday (observed Monday)\n1*1:0:1:0:0:0*IW7,FD1           = New Year's Day\n# M-F\n1*1:0:1:0:0:0*IBD               = New Year's Day\n",
            "subsections": []
        },
        "EVENTS": {
            "content": "The Events section of the config file is similar to the Holiday\nsection.  It is used to name certain days or times, but there are a few\nimportant differences:\n\nEvents can be assigned to any time and duration\nAll holidays are exactly 1 day long.  They are assigned to a period\nof time from midnight to midnight.\n\nEvents can be based at any time of the day, and may be of any\nduration.\n\nEvents don't affect business mode calculations\nUnlike holidays, events are completely ignored when doing business\nmode calculations.\n\nWhereas holidays were added with business mode math in mind, events\nwere added with calendar and scheduling applications in mind.\n\nEvery line in the events section is of the form:\n\nEVENT = NAME\n\nwhere NAME is the name of the event, and EVENT defines when it occurs\nand its duration.  An EVENT can be defined in the following ways:\n\nDate\nYMD\nYM\nRecur\n\nDate  ; Date\nYMD   ; YMD\nYM    ; YM\nDate  ; Delta\nRecur ; Delta\n\nDate refers to a full date/time (and is any string that can be parsed\nby \"Date::Manip::Date::parse\"). YMD is any string which can be parsed\nby \"Date::Manip::Date::parsedate\". YM is any string which can be\nparsed by the parsedate method to give a date in the current year.\nRecur is a partial or fully specified recurrence. Delta is any string\nthat can be parsed to form a delta.\n\nWith the \"Date\" form, or the \"Recur\" form, the event starts at the time\n(or times) specified by the date or recurrence, and last 1 hour long.\nWith the \"YMD\" and \"YM\" forms, the event occurs on the given day, and\nlasts all day.\n\nWith all of the two part forms (\"Date;Date\", \"YM;YM\", etc.), the event\nstarts at the first date and goes to the second date, or goes an amount\nof time specified by the delta.\n\nThe \"YMD;YMD\" and \"YM;YM\" forms means that the event lasts from the\nstart of the first date to the end of the second. In the Date;Date\nform, the event goes from the first date to the second date inclusive.\nIn other words, both dates are in the event. In the \"Date;Delta\" and\n\"Recur;Delta\" forms, the Delta tells the length of the event. Also, in\nthe Date;Date form, the second date may NOT be expressed as a delta.\n\nCurrently, having an event longer than 1 year is NOT supported, but no\nchecking is done for this.\n",
            "subsections": []
        },
        "KNOWN BUGS": {
            "content": "None known.\n",
            "subsections": []
        },
        "BUGS AND QUESTIONS": {
            "content": "Please refer to the Date::Manip::Problems documentation for information\non submitting bug reports or questions to the author.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Date::Manip        - main module documentation\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "This script is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Sullivan Beck (sbeck@cpan.org)\n\nperl v5.32.1                      2021-11-20        Date::Manip::Holidays(3pm)",
            "subsections": []
        }
    },
    "summary": "Date::Manip::Holidays - describes holidays and events",
    "flags": [],
    "examples": [],
    "see_also": []
}