{
    "content": [
        {
            "type": "text",
            "text": "# DateTime (man)\n\n## NAME\n\nDateTime - A date and time object for Perl\n\n## SYNOPSIS\n\nuse DateTime;\n$dt = DateTime->new(\nyear       => 1964,\nmonth      => 10,\nday        => 16,\nhour       => 16,\nminute     => 12,\nsecond     => 47,\nnanosecond => 500000000,\ntimezone  => 'Asia/Taipei',\n);\n$dt = DateTime->fromepoch( epoch => $epoch );\n$dt = DateTime->now;    # same as ( epoch => time )\n$year  = $dt->year;\n$month = $dt->month;        # 1-12\n$day = $dt->day;            # 1-31\n$dow = $dt->dayofweek;    # 1-7 (Monday is 1)\n$hour   = $dt->hour;        # 0-23\n$minute = $dt->minute;      # 0-59\n$second = $dt->second;      # 0-61 (leap seconds!)\n$doy = $dt->dayofyear;    # 1-366 (leap years)\n$doq = $dt->dayofquarter; # 1..\n$qtr = $dt->quarter;        # 1-4\n# all of the start-at-1 methods above have corresponding start-at-0\n# methods, such as $dt->dayofmonth0, $dt->month0 and so on\n$ymd = $dt->ymd;         # 2002-12-06\n$ymd = $dt->ymd('/');    # 2002/12/06\n$mdy = $dt->mdy;         # 12-06-2002\n$mdy = $dt->mdy('/');    # 12/06/2002\n$dmy = $dt->dmy;         # 06-12-2002\n$dmy = $dt->dmy('/');    # 06/12/2002\n$hms = $dt->hms;         # 14:02:29\n$hms = $dt->hms('!');    # 14!02!29\n$isleap = $dt->isleapyear;\n# these are localizable, see Locales section\n$monthname = $dt->monthname;    # January, February, ...\n$monthabbr = $dt->monthabbr;    # Jan, Feb, ...\n$dayname   = $dt->dayname;      # Monday, Tuesday, ...\n$dayabbr   = $dt->dayabbr;      # Mon, Tue, ...\n# May not work for all possible datetime, see the docs on this\n# method for more details.\n$epochtime = $dt->epoch;\n$dt2 = $dt + $durationobject;\n$dt3 = $dt - $durationobject;\n$durationobject = $dt - $dt2;\n$dt->set( year => 1882 );\n$dt->settimezone('America/Chicago');\n$dt->setformatter($formatter);\n\n## DESCRIPTION\n\nDateTime is a class for the representation of date/time combinations, and is part of the Perl\nDateTime project.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **USAGE** (10 subsections)\n- **METHODS** (13 subsections)\n- **DEVELOPMENT TOOLS**\n- **THE DATETIME PROJECT ECOSYSTEM** (5 subsections)\n- **KNOWN BUGS**\n- **SEE ALSO**\n- **SUPPORT**\n- **SOURCE**\n- **DONATIONS**\n- **AUTHOR**\n- **CONTRIBUTORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "DateTime",
        "section": "",
        "mode": "man",
        "summary": "DateTime - A date and time object for Perl",
        "synopsis": "use DateTime;\n$dt = DateTime->new(\nyear       => 1964,\nmonth      => 10,\nday        => 16,\nhour       => 16,\nminute     => 12,\nsecond     => 47,\nnanosecond => 500000000,\ntimezone  => 'Asia/Taipei',\n);\n$dt = DateTime->fromepoch( epoch => $epoch );\n$dt = DateTime->now;    # same as ( epoch => time )\n$year  = $dt->year;\n$month = $dt->month;        # 1-12\n$day = $dt->day;            # 1-31\n$dow = $dt->dayofweek;    # 1-7 (Monday is 1)\n$hour   = $dt->hour;        # 0-23\n$minute = $dt->minute;      # 0-59\n$second = $dt->second;      # 0-61 (leap seconds!)\n$doy = $dt->dayofyear;    # 1-366 (leap years)\n$doq = $dt->dayofquarter; # 1..\n$qtr = $dt->quarter;        # 1-4\n# all of the start-at-1 methods above have corresponding start-at-0\n# methods, such as $dt->dayofmonth0, $dt->month0 and so on\n$ymd = $dt->ymd;         # 2002-12-06\n$ymd = $dt->ymd('/');    # 2002/12/06\n$mdy = $dt->mdy;         # 12-06-2002\n$mdy = $dt->mdy('/');    # 12/06/2002\n$dmy = $dt->dmy;         # 06-12-2002\n$dmy = $dt->dmy('/');    # 06/12/2002\n$hms = $dt->hms;         # 14:02:29\n$hms = $dt->hms('!');    # 14!02!29\n$isleap = $dt->isleapyear;\n# these are localizable, see Locales section\n$monthname = $dt->monthname;    # January, February, ...\n$monthabbr = $dt->monthabbr;    # Jan, Feb, ...\n$dayname   = $dt->dayname;      # Monday, Tuesday, ...\n$dayabbr   = $dt->dayabbr;      # Mon, Tue, ...\n# May not work for all possible datetime, see the docs on this\n# method for more details.\n$epochtime = $dt->epoch;\n$dt2 = $dt + $durationobject;\n$dt3 = $dt - $durationobject;\n$durationobject = $dt - $dt2;\n$dt->set( year => 1882 );\n$dt->settimezone('America/Chicago');\n$dt->setformatter($formatter);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 73,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "USAGE",
                "lines": 1,
                "subsections": [
                    {
                        "name": "0-based Versus 1-based Numbers",
                        "lines": 16
                    },
                    {
                        "name": "Error Handling",
                        "lines": 5
                    },
                    {
                        "name": "Locales",
                        "lines": 4
                    },
                    {
                        "name": "Floating DateTimes",
                        "lines": 13
                    },
                    {
                        "name": "Math",
                        "lines": 2
                    },
                    {
                        "name": "Determining the Local Time Zone Can Be Slow",
                        "lines": 14
                    },
                    {
                        "name": "Far Future DST",
                        "lines": 5
                    },
                    {
                        "name": "Globally Setting a Default Time Zone",
                        "lines": 1
                    },
                    {
                        "name": "Warning: This is very dangerous. Do this at your own risk!",
                        "lines": 13
                    },
                    {
                        "name": "Upper and Lower Bounds",
                        "lines": 7
                    }
                ]
            },
            {
                "name": "METHODS",
                "lines": 3,
                "subsections": [
                    {
                        "name": "Constructors",
                        "lines": 211
                    },
                    {
                        "name": "\"Get\" Methods",
                        "lines": 405
                    },
                    {
                        "name": "\"Set\" Methods",
                        "lines": 18
                    },
                    {
                        "name": "Do not use this method to do date math. Use the \"add\" and \"subtract\" methods instead.",
                        "lines": 80
                    },
                    {
                        "name": "Math Methods",
                        "lines": 90
                    },
                    {
                        "name": "Class Methods",
                        "lines": 41
                    },
                    {
                        "name": "Testing Code That Uses DateTime",
                        "lines": 13
                    },
                    {
                        "name": "How DateTime Math Works",
                        "lines": 417
                    },
                    {
                        "name": "Overloading",
                        "lines": 25
                    },
                    {
                        "name": "Formatters And Stringification",
                        "lines": 22
                    },
                    {
                        "name": "CLDR Patterns",
                        "lines": 297
                    },
                    {
                        "name": "strftime Patterns",
                        "lines": 195
                    },
                    {
                        "name": "DateTime and Storable",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "DEVELOPMENT TOOLS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "THE DATETIME PROJECT ECOSYSTEM",
                "lines": 2,
                "subsections": [
                    {
                        "name": "DateTime::Set",
                        "lines": 3
                    },
                    {
                        "name": "Format Modules",
                        "lines": 14
                    },
                    {
                        "name": "Calendar Modules",
                        "lines": 6
                    },
                    {
                        "name": "Event Modules",
                        "lines": 6
                    },
                    {
                        "name": "Others",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "KNOWN BUGS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SOURCE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DONATIONS",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONTRIBUTORS",
                "lines": 66,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 12,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "DateTime - A date and time object for Perl\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 1.55\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use DateTime;\n\n$dt = DateTime->new(\nyear       => 1964,\nmonth      => 10,\nday        => 16,\nhour       => 16,\nminute     => 12,\nsecond     => 47,\nnanosecond => 500000000,\ntimezone  => 'Asia/Taipei',\n);\n\n$dt = DateTime->fromepoch( epoch => $epoch );\n$dt = DateTime->now;    # same as ( epoch => time )\n\n$year  = $dt->year;\n$month = $dt->month;        # 1-12\n\n$day = $dt->day;            # 1-31\n\n$dow = $dt->dayofweek;    # 1-7 (Monday is 1)\n\n$hour   = $dt->hour;        # 0-23\n$minute = $dt->minute;      # 0-59\n\n$second = $dt->second;      # 0-61 (leap seconds!)\n\n$doy = $dt->dayofyear;    # 1-366 (leap years)\n\n$doq = $dt->dayofquarter; # 1..\n\n$qtr = $dt->quarter;        # 1-4\n\n# all of the start-at-1 methods above have corresponding start-at-0\n# methods, such as $dt->dayofmonth0, $dt->month0 and so on\n\n$ymd = $dt->ymd;         # 2002-12-06\n$ymd = $dt->ymd('/');    # 2002/12/06\n\n$mdy = $dt->mdy;         # 12-06-2002\n$mdy = $dt->mdy('/');    # 12/06/2002\n\n$dmy = $dt->dmy;         # 06-12-2002\n$dmy = $dt->dmy('/');    # 06/12/2002\n\n$hms = $dt->hms;         # 14:02:29\n$hms = $dt->hms('!');    # 14!02!29\n\n$isleap = $dt->isleapyear;\n\n# these are localizable, see Locales section\n$monthname = $dt->monthname;    # January, February, ...\n$monthabbr = $dt->monthabbr;    # Jan, Feb, ...\n$dayname   = $dt->dayname;      # Monday, Tuesday, ...\n$dayabbr   = $dt->dayabbr;      # Mon, Tue, ...\n\n# May not work for all possible datetime, see the docs on this\n# method for more details.\n$epochtime = $dt->epoch;\n\n$dt2 = $dt + $durationobject;\n\n$dt3 = $dt - $durationobject;\n\n$durationobject = $dt - $dt2;\n\n$dt->set( year => 1882 );\n\n$dt->settimezone('America/Chicago');\n\n$dt->setformatter($formatter);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "DateTime is a class for the representation of date/time combinations, and is part of the Perl\nDateTime project.\n\nIt represents the Gregorian calendar, extended backwards in time before its creation (in\n1582). This is sometimes known as the \"proleptic Gregorian calendar\". In this calendar, the\nfirst day of the calendar (the epoch), is the first day of year 1, which corresponds to the\ndate which was (incorrectly) believed to be the birth of Jesus Christ.\n\nThe calendar represented does have a year 0, and in that way differs from how dates are often\nwritten using \"BCE/CE\" or \"BC/AD\".\n\nFor infinite datetimes, please see the DateTime::Infinite module.\n",
                "subsections": []
            },
            "USAGE": {
                "content": "",
                "subsections": [
                    {
                        "name": "0-based Versus 1-based Numbers",
                        "content": "The \"DateTime\" module follows a simple logic for determining whether or not a given number is\n0-based or 1-based.\n\nMonth, day of month, day of week, and day of year are 1-based. Any method that is 1-based\nalso has an equivalent 0-based method ending in \"0\". So for example, this class provides\nboth \"dayofweek\" and \"dayofweek0\" methods.\n\nThe \"dayofweek0\" method still treats Monday as the first day of the week.\n\nAll time-related numbers such as hour, minute, and second are 0-based.\n\nYears are neither, as they can be both positive or negative, unlike any other datetime\ncomponent. There is a year 0.\n\nThere is no \"quarter0\" method.\n"
                    },
                    {
                        "name": "Error Handling",
                        "content": "Some errors may cause this module to die with an error string. This can only happen when\ncalling constructor methods, methods that change the object, such as \"set\", or methods that\ntake parameters. Methods that retrieve information about the object, such as \"year\" or\n\"epoch\", will never die.\n"
                    },
                    {
                        "name": "Locales",
                        "content": "All the object methods which return names or abbreviations return data based on a locale.\nThis is done by setting the locale when constructing a DateTime object. If this is not set,\nthen \"en-US\" is used.\n"
                    },
                    {
                        "name": "Floating DateTimes",
                        "content": "The default time zone for new DateTime objects, except where stated otherwise, is the\n\"floating\" time zone. This concept comes from the iCal standard. A floating datetime is one\nwhich is not anchored to any particular time zone. In addition, floating datetimes do not\ninclude leap seconds, since we cannot apply them without knowing the datetime's time zone.\n\nThe results of date math and comparison between a floating datetime and one with a real time\nzone are not really valid, because one includes leap seconds and the other does not.\nSimilarly, the results of datetime math between two floating datetimes and two datetimes with\ntime zones are not really comparable.\n\nIf you are planning to use any objects with a real time zone, it is strongly recommended that\nyou do not mix these with floating datetimes.\n"
                    },
                    {
                        "name": "Math",
                        "content": "If you are going to be doing date math, please read the section \"How DateTime Math Works\".\n"
                    },
                    {
                        "name": "Determining the Local Time Zone Can Be Slow",
                        "content": "If $ENV{TZ} is not set, it may involve reading a number of files in /etc or elsewhere. If you\nknow that the local time zone won't change while your code is running, and you need to make\nmany objects for the local time zone, it is strongly recommended that you retrieve the local\ntime zone once and cache it:\n\nour $App::LocalTZ = DateTime::TimeZone->new( name => 'local' );\n\n# then everywhere else\n\nmy $dt = DateTime->new( ..., timezone => $App::LocalTZ );\n\nDateTime itself does not do this internally because local time zones can change, and there's\nno good way to determine if it's changed without doing all the work to look it up.\n"
                    },
                    {
                        "name": "Far Future DST",
                        "content": "Do not try to use named time zones (like \"America/Chicago\") with dates very far in the future\n(thousands of years). The current implementation of \"DateTime::TimeZone\" will use a huge\namount of memory calculating all the DST changes from now until the future date. Use UTC or\nthe floating time zone and you will be safe.\n"
                    },
                    {
                        "name": "Globally Setting a Default Time Zone",
                        "content": ""
                    },
                    {
                        "name": "Warning: This is very dangerous. Do this at your own risk!",
                        "content": "By default, \"DateTime\" uses either the floating time zone or UTC for newly created objects,\ndepending on the constructor.\n\nYou can force \"DateTime\" to use a different time zone by setting the\n\"PERLDATETIMEDEFAULTTZ\" environment variable.\n\nAs noted above, this is very dangerous, as it affects all code that creates a \"DateTime\"\nobject, including modules from CPAN. If those modules expect the normal default, then setting\nthis can cause confusing breakage or subtly broken data. Before setting this variable, you\nare strongly encouraged to audit your CPAN dependencies to see how they use \"DateTime\". Try\nrunning the test suite for each dependency with this environment variable set before using\nthis in production.\n"
                    },
                    {
                        "name": "Upper and Lower Bounds",
                        "content": "Internally, dates are represented the number of days before or after 0001-01-01. This is\nstored as an integer, meaning that the upper and lower bounds are based on your Perl's\ninteger size ($Config{ivsize}).\n\nThe limit on 32-bit systems is around 2^29 days, which gets you to year (+/-)1,469,903. On a\n64-bit system you get 2^62 days, to year (+/-)12,626,367,463,883,278 (12.626 quadrillion).\n"
                    }
                ]
            },
            "METHODS": {
                "content": "DateTime provides many methods. The documentation breaks them down into groups based on what\nthey do (constructor, accessors, modifiers, etc.).\n",
                "subsections": [
                    {
                        "name": "Constructors",
                        "content": "All constructors can die when invalid parameters are given.\n\nWarnings\n\nCurrently, constructors will warn if you try to create a far future DateTime (year >= 5000)\nwith any time zone besides floating or UTC. This can be very slow if the time zone has future\nDST transitions that need to be calculated. If the date is sufficiently far in the future\nthis can be really slow (minutes).\n\nAll warnings from DateTime use the \"DateTime\" category and can be suppressed with:\n\nno warnings 'DateTime';\n\nThis warning may be removed in the future if DateTime::TimeZone is made much faster.\n\nDateTime->new( ... )\n\nmy $dt = DateTime->new(\nyear       => 1966,\nmonth      => 10,\nday        => 25,\nhour       => 7,\nminute     => 15,\nsecond     => 47,\nnanosecond => 500000000,\ntimezone  => 'America/Chicago',\n);\n\nThis class method accepts the following parameters:\n\n•   year\n\nAn integer year for the DateTime. This can be any integer number within the valid range\nfor your system (See \"Upper and Lower Bounds\"). This is required.\n\n•   month\n\nAn integer from 1-12. Defaults to 1.\n\n•   day\n\nAn integer from 1-31. The value will be validated based on the month, to prevent creating\ninvalid dates like February 30. Defaults to 1.\n\n•   hour\n\nAn integer from 0-23. Hour 0 is midnight at the beginning of the given date.  Defaults to\n0.\n\n•   minute\n\nAn integer from 0-59. Defaults to 0.\n\n•   second\n\nAn integer from 0-61. Values of 60 or 61 are only allowed when the specified date and\ntime have a leap second. Defaults to 0.\n\n•   nanosecond\n\nAn integer that is greater than or equal to 0. If this number is greater than 1 billion,\nit will be normalized into the second value for the DateTime object.  Defaults to 0\n\n•   locale\n\nA string containing a locale code, like \"en-US\" or \"zh-Hant-TW\", or an object returned by\n\"DateTime::Locale->load\". See the DateTime::Locale documentation for details. Defaults to\nthe value of \"DateTime->DefaultLocale\", or \"en-US\" if the class default has not been set.\n\n•   timezone\n\nA string containing a time zone name like \"America/Chicago\" or a DateTime::TimeZone\nobject. Defaults to the value of $ENV{PERLDATETIMEDEFAULTTZ} or \"floating\" if that env\nvar is not set. See \"Globally Setting a Default Time Zone\" for more details on that env\nvar (and why you should not use it).\n\nA string will simply be passed to the \"DateTime::TimeZone->new\" method as its \"name\"\nparameter. This string may be an Olson DB time zone name (\"America/Chicago\"), an offset\nstring (\"+0630\"), or the words \"floating\" or \"local\". See the \"DateTime::TimeZone\"\ndocumentation for more details.\n\n•   formatter\n\nAn object or class name with a \"formatdatetime\" method. This will be used to stringify\nthe DateTime object. This is optional. If it is not specified, then stringification calls\n\"$self->iso8601\".\n\nInvalid parameter types (like an array reference) will cause the constructor to die.\n\nParsing Dates\n\nThis module does not parse dates! That means there is no constructor to which you can pass\nthings like \"March 3, 1970 12:34\".\n\nInstead, take a look at the various DateTime::Format::*\n<https://metacpan.org/search?q=datetime%3A%3Aformat> modules on CPAN. These parse all sorts\nof different date formats, and you're bound to find something that can handle your particular\nneeds.\n\nAmbiguous Local Times\n\nBecause of Daylight Saving Time, it is possible to specify a local time that is ambiguous.\nFor example, in the US in 2003, the transition from to saving to standard time occurred on\nOctober 26, at 02:00:00 local time. The local clock changed from 01:59:59 (saving time) to\n01:00:00 (standard time). This means that the hour from 01:00:00 through 01:59:59 actually\noccurs twice, though the UTC time continues to move forward.\n\nIf you specify an ambiguous time, then the latest UTC time is always used, in effect always\nchoosing standard time. In this case, you can simply subtract an hour from the object in\norder to move to saving time, for example:\n\n# This object represent 01:30:00 standard time\nmy $dt = DateTime->new(\nyear      => 2003,\nmonth     => 10,\nday       => 26,\nhour      => 1,\nminute    => 30,\nsecond    => 0,\ntimezone => 'America/Chicago',\n);\n\nprint $dt->hms;    # prints 01:30:00\n\n# Now the object represent 01:30:00 saving time\n$dt->subtract( hours => 1 );\n\nprint $dt->hms;    # still prints 01:30:00\n\nAlternately, you could create the object with the UTC time zone and then call the\n\"settimezone\" method to change the time zone. This is a good way to ensure that the time is\nnot ambiguous.\n\nInvalid Local Times\n\nAnother problem introduced by Daylight Saving Time is that certain local times just do not\nexist. For example, in the US in 2003, the transition from standard to saving time occurred\non April 6, at the change to 2:00:00 local time. The local clock changed from 01:59:59\n(standard time) to 03:00:00 (saving time).  This means that there is no 02:00:00 through\n02:59:59 on April 6!\n\nAttempting to create an invalid time currently causes a fatal error.\n\nDateTime->fromepoch( epoch => $epoch, ... )\n\nThis class method can be used to construct a new DateTime object from an epoch time instead\nof components. Just as with the \"new\" method, it accepts \"timezone\", \"locale\", and\n\"formatter\" parameters.\n\nIf the epoch value is a non-integral value, it will be rounded to nearest microsecond.\n\nBy default, the returned object will be in the UTC time zone.\n\nIf you pass a \"timezone\", then this time zone will be applied after the object is\nconstructed. In other words, the epoch value is always interpreted as being in the UTC time\nzone. Here's an example:\n\nmy $dt = DateTime->fromepoch(\nepoch     => 0,\ntimezone => 'Asia/Tokyo'\n);\nsay $dt; # Prints 1970-01-01T09:00:00 as Asia/Tokyo is +09:00 from UTC.\n$dt->settimezone('UTC');\nsay $dt; # Prints 1970-01-01T00:00:00\n\nDateTime->now( ... )\n\nThis class method is equivalent to calling \"fromepoch\" with the value returned from Perl's\n\"time\" function. Just as with the \"new\" method, it accepts \"timezone\" and \"locale\"\nparameters.\n\nBy default, the returned object will be in the UTC time zone.\n\nIf you want sub-second resolution, use the DateTime::HiRes module's \"DateTime::HiRes->now\"\nmethod instead.\n\nDateTime->today( ... )\n\nThis class method is equivalent to:\n\nDateTime->now(@)->truncate( to => 'day' );\n\nDateTime->lastdayofmonth( ... )\n\nThis constructor takes the same arguments as can be given to the \"new\" method, except for\n\"day\". Additionally, both \"year\" and \"month\" are required.\n\nDateTime->fromdayofyear( ... )\n\nThis constructor takes the same arguments as can be given to the \"new\" method, except that it\ndoes not accept a \"month\" or \"day\" argument. Instead, it requires both \"year\" and\n\"dayofyear\". The day of year must be between 1 and 366, and 366 is only allowed for leap\nyears.\n\nDateTime->fromobject( object => $object, ... )\n\nThis class method can be used to construct a new DateTime object from any object that\nimplements the \"utcrdvalues\" method. All \"DateTime::Calendar\" modules must implement this\nmethod in order to provide cross-calendar compatibility. This method accepts a \"locale\" and\n\"formatter\" parameter\n\nIf the object passed to this method has a \"timezone\" method, that is used to set the time\nzone of the newly created \"DateTime\" object.\n\nOtherwise, the returned object will be in the floating time zone.\n\n$dt->clone\n\nThis object method returns a new object that is replica of the object upon which the method\nis called.\n"
                    },
                    {
                        "name": "\"Get\" Methods",
                        "content": "This class has many methods for retrieving information about an object.\n\n$dt->year\n\nReturns the year.\n\n$dt->ceyear\n\nReturns the year according to the BCE/CE numbering system. The year before year 1 in this\nsystem is year -1, aka \"1 BCE\".\n\n$dt->eraname\n\nReturns the long name of the current era, something like \"Before Christ\". See the \"Locales\"\nsection for more details.\n\n$dt->eraabbr\n\nReturns the abbreviated name of the current era, something like \"BC\". See the \"Locales\"\nsection for more details.\n\n$dt->christianera\n\nReturns a string, either \"BC\" or \"AD\", according to the year.\n\n$dt->secularera\n\nReturns a string, either \"BCE\" or \"CE\", according to the year.\n\n$dt->yearwithera\n\nReturns a string containing the year immediately followed by the appropriate era\nabbreviation, based on the object's locale. The year is the absolute value of \"ceyear\", so\nthat year 1 is \"1\" and year 0 is \"1BC\". See the \"Locales\" section for more details.\n\n$dt->yearwithchristianera\n\nLike \"yearwithera\", but uses the \"christianera\" method to get the era name.\n\n$dt->yearwithsecularera\n\nLike \"yearwithera\", but uses the \"secularera\" method to get the era name.\n\n$dt->month\n\nReturns the month of the year, from 1..12.\n\nAlso available as \"$dt->mon\".\n\n$dt->monthname\n\nReturns the name of the current month. See the \"Locales\" section for more details.\n\n$dt->monthabbr\n\nReturns the abbreviated name of the current month. See the \"Locales\" section for more\ndetails.\n\n$dt->day\n\nReturns the day of the month, from 1..31.\n\nAlso available as \"$dt->mday\" and \"$dt->dayofmonth\".\n\n$dt->dayofweek\n\nReturns the day of the week as a number, from 1..7, with 1 being Monday and 7 being Sunday.\n\nAlso available as \"$dt->wday\" and \"$dt->dow\".\n\n$dt->localdayofweek\n\nReturns the day of the week as a number, from 1..7. The day corresponding to 1 will vary\nbased on the locale. See the \"Locales\" section for more details.\n\n$dt->dayname\n\nReturns the name of the current day of the week. See the \"Locales\" section for more details.\n\n$dt->dayabbr\n\nReturns the abbreviated name of the current day of the week. See the \"Locales\" section for\nmore details.\n\n$dt->dayofyear\n\nReturns the day of the year.\n\nAlso available as \"$dt->doy\".\n\n$dt->quarter\n\nReturns the quarter of the year, from 1..4.\n\n$dt->quartername\n\nReturns the name of the current quarter. See the \"Locales\" section for more details.\n\n$dt->quarterabbr\n\nReturns the abbreviated name of the current quarter. See the \"Locales\" section for more\ndetails.\n\n$dt->dayofquarter\n\nReturns the day of the quarter.\n\nAlso available as \"$dt->doq\".\n\n$dt->weekdayofmonth\n\nReturns a number from 1..5 indicating which week day of the month this is. For example, June\n9, 2003 is the second Monday of the month, and so this method returns 2 for that date.\n\n$dt->ymd($optionalseparator), $dt->mdy(...), $dt->dmy(...)\n\nEach method returns the year, month, and day, in the order indicated by the method name.\nYears are zero-padded to four digits. Months and days are 0-padded to two digits.\n\nBy default, the values are separated by a dash (-), but this can be overridden by passing a\nvalue to the method.\n\nThe \"$dt->ymd\" method is also available as \"$dt->date\".\n\n$dt->hour\n\nReturns the hour of the day, from 0..23.\n\n$dt->hour1\n\nReturns the hour of the day, from 1..24.\n\n$dt->hour12\n\nReturns the hour of the day, from 1..12.\n\n$dt->hour120\n\nReturns the hour of the day, from 0..11.\n\n$dt->amorpm\n\nReturns the appropriate localized abbreviation, depending on the current hour.\n\n$dt->minute\n\nReturns the minute of the hour, from 0..59.\n\nAlso available as \"$dt->min\".\n\n$dt->second\n\nReturns the second, from 0..61. The values 60 and 61 are used for leap seconds.\n\nAlso available as \"$dt->sec\".\n\n$dt->fractionalsecond\n\nReturns the second, as a real number from 0.0 until 61.999999999\n\nThe values 60 and 61 are used for leap seconds.\n\n$dt->millisecond\n\nReturns the fractional part of the second as milliseconds (1E-3 seconds).\n\nHalf a second is 500 milliseconds.\n\nThis value will always be rounded down to the nearest integer.\n\n$dt->microsecond\n\nReturns the fractional part of the second as microseconds (1E-6 seconds).\n\nHalf a second is 500,000 microseconds.\n\nThis value will always be rounded down to the nearest integer.\n\n$dt->nanosecond\n\nReturns the fractional part of the second as nanoseconds (1E-9 seconds).\n\nHalf a second is 500,000,000 nanoseconds.\n\n$dt->hms($optionalseparator)\n\nReturns the hour, minute, and second, all zero-padded to two digits. If no separator is\nspecified, a colon (:) is used by default.\n\nAlso available as \"$dt->time\".\n\n$dt->datetime($optionalseparator)\n\nThis method is equivalent to:\n\n$dt->ymd('-') . 'T' . $dt->hms(':')\n\nThe $optionalseparator parameter allows you to override the separator between the date and\ntime, for e.g. \"$dt->datetime(q{ })\".\n\nThis method is also available as \"$dt->iso8601\", but it's not really a very good ISO8601\nformat, as it lacks a time zone. If called as \"$dt->iso8601\" you cannot change the separator,\nas ISO8601 specifies that \"T\" must be used to separate them.\n\n$dt->rfc3339\n\nThis formats a datetime in RFC3339 format. This is the same as \"$dt->datetime\" with an added\noffset at the end of the string except if the time zone is the floating time zone.\n\nIf the offset is '+00:00' then this is represented as 'Z'. Otherwise the offset is formatted\nwith a leading sign (+/-) and a colon separated numeric offset with hours and minutes. If the\noffset has a non-zero seconds component, that is also included.\n\n$dt->stringify\n\nThis method returns a stringified version of the object. It is also how stringification\noverloading is implemented. If the object has a formatter, then its \"formatdatetime\" method\nis used to produce a string. Otherwise, this method calls \"$dt->iso8601\" to produce a string.\nSee \"Formatters And Stringification\" for details.\n\n$dt->isleapyear\n\nThis method returns a boolean value indicating whether or not the datetime object is in a\nleap year.\n\n$dt->islastdayofmonth\n\nThis method returns a boolean value indicating whether or not the datetime object is the last\nday of the month.\n\n$dt->islastdayofquarter\n\nThis method returns a boolean value indicating whether or not the datetime object is the last\nday of the quarter.\n\n$dt->islastdayofyear\n\nThis method returns a boolean value indicating whether or not the datetime object is the last\nday of the year.\n\n$dt->monthlength\n\nThis method returns the number of days in the current month.\n\n$dt->quarterlength\n\nThis method returns the number of days in the current quarter.\n\n$dt->yearlength\n\nThis method returns the number of days in the current year.\n\n$dt->week\n\nmy ( $weekyear, $weeknumber ) = $dt->week;\n\nReturns information about the calendar week for the date. The values returned by this method\nare also available separately through the \"$dt->weekyear\" and \"$dt->weeknumber\" methods.\n\nThe first week of the year is defined by ISO as the one which contains the fourth day of\nJanuary, which is equivalent to saying that it's the first week to overlap the new year by at\nleast four days.\n\nTypically the week year will be the same as the year that the object is in, but dates at the\nvery beginning of a calendar year often end up in the last week of the prior year, and\nsimilarly, the final few days of the year may be placed in the first week of the next year.\n\n$dt->weekyear\n\nReturns the year of the week. See \"$dt->week\" for details.\n\n$dt->weeknumber\n\nReturns the week of the year, from 1..53. See \"$dt->week\" for details.\n\n$dt->weekofmonth\n\nThe week of the month, from 0..5. The first week of the month is the first week that contains\na Thursday. This is based on the ICU definition of week of month, and correlates to the\nISO8601 week of year definition. A day in the week before the week with the first Thursday\nwill be week 0.\n\n$dt->jd, $dt->mjd\n\nThese return the Julian Day and Modified Julian Day, respectively. The value returned is a\nfloating point number. The fractional portion of the number represents the time portion of\nthe datetime.\n\nThe Julian Day is a count of days since the beginning of the Julian Period, which starts with\nday 0 at noon on January 1, -4712.\n\nThe Modified Julian Day is a count of days since midnight on November 17, 1858.\n\nThese methods always refer to the local time, so the Julian Day is the same for a given\ndatetime regardless of its time zone. Or in other words, 2020-12-04T13:01:57 in\n\"America/Chicago\" has the same Julian Day as 2020-12-04T13:01:57 in \"Asia/Taipei\".\n\n$dt->timezone\n\nThis returns the DateTime::TimeZone object for the datetime object.\n\n$dt->offset\n\nThis returns the offset from UTC, in seconds, of the datetime object's time zone.\n\n$dt->isdst\n\nReturns a boolean indicating whether or not the datetime's time zone is currently in Daylight\nSaving Time or not.\n\n$dt->timezonelongname\n\nThis is a shortcut for \"$dt->timezone->name\". It's provided so that one can use\n\"%{timezonelongname}\" as a strftime format specifier.\n\n$dt->timezoneshortname\n\nThis method returns the time zone abbreviation for the current time zone, such as \"PST\" or\n\"GMT\". These names are not definitive, and should not be used in any application intended for\ngeneral use by users around the world. That's because it's possible for multiple time zones\nto have the same abbreviation.\n\n$dt->strftime( $format, ... )\n\nThis method implements functionality similar to the \"strftime\" method in C.  However, if\ngiven multiple format strings, then it will return multiple scalars, one for each format\nstring.\n\nSee the \"strftime Patterns\" section for a list of all possible strftime patterns.\n\nIf you give a pattern that doesn't exist, then it is simply treated as text.\n\nNote that any deviation from the POSIX standard is probably a bug. DateTime should match the\noutput of \"POSIX::strftime\" for any given pattern.\n\n$dt->formatcldr( $format, ... )\n\nThis method implements formatting based on the CLDR date patterns. If given multiple format\nstrings, then it will return multiple scalars, one for each format string.\n\nSee the \"CLDR Patterns\" section for a list of all possible CLDR patterns.\n\nIf you give a pattern that doesn't exist, then it is simply treated as text.\n\n$dt->epoch\n\nReturns the UTC epoch value for the datetime object. Datetimes before the start of the epoch\nwill be returned as a negative number.\n\nThe return value from this method is always an integer number of seconds.\n\nSince the epoch does not account for leap seconds, the epoch time for 1972-12-31T23:59:60\n(UTC) is exactly the same as that for 1973-01-01T00:00:00.\n\n$dt->hiresepoch\n\nReturns the epoch as a floating point number. The floating point portion of the value\nrepresents the nanosecond value of the object. This method is provided for compatibility with\nthe \"Time::HiRes\" module.\n\nNote that this method suffers from the imprecision of floating point numbers, and the result\nmay end up rounded to an arbitrary degree depending on your platform.\n\nmy $dt = DateTime->new( year => 2012, nanosecond => 4 );\nsay $dt->hiresepoch;\n\nOn my system, this simply prints 1325376000 because adding 0.000000004 to 1325376000 returns\n1325376000.\n\n$dt->isfinite, $dt->isinfinite\n\nThese methods allow you to distinguish normal datetime objects from infinite ones. Infinite\ndatetime objects are documented in DateTime::Infinite.\n\n$dt->utcrdvalues\n\nReturns the current UTC Rata Die days, seconds, and nanoseconds as a three element list. This\nexists primarily to allow other calendar modules to create objects based on the values\nprovided by this object.\n\n$dt->localrdvalues\n\nReturns the current local Rata Die days, seconds, and nanoseconds as a three element list.\nThis exists for the benefit of other modules which might want to use this information for\ndate math, such as DateTime::Event::Recurrence.\n\n$dt->leapseconds\n\nReturns the number of leap seconds that have happened up to the datetime represented by the\nobject. For floating datetimes, this always returns 0.\n\n$dt->utcrdasseconds\n\nReturns the current UTC Rata Die days and seconds purely as seconds. This number ignores any\nfractional seconds stored in the object, as well as leap seconds.\n\n$dt->locale\n\nReturns the datetime's DateTime::Locale object.\n\n$dt->formatter\n\nReturns the current formatter object or class. See \"Formatters And Stringification\" for\ndetails.\n"
                    },
                    {
                        "name": "\"Set\" Methods",
                        "content": "The remaining methods provided by \"DateTime\", except where otherwise specified, return the\nobject itself, thus making method chaining possible. For example:\n\nmy $dt = DateTime->now->settimezone( 'Australia/Sydney' );\n\nmy $first = DateTime\n->lastdayofmonth( year => 2003, month => 3 )\n->add( days => 1 )\n->subtract( seconds => 1 );\n\n$dt->set( .. )\n\nThis method can be used to change the local components of a date time. This method accepts\nany parameter allowed by the \"new\" method except for \"locale\" or \"timezone\". Use\n\"setlocale\" and \"settimezone\" for those instead.\n\nThis method performs parameter validation just like the \"new\" method.\n"
                    },
                    {
                        "name": "Do not use this method to do date math. Use the \"add\" and \"subtract\" methods instead.",
                        "content": "$dt->setyear, $dt->setmonth, etc.\n\nDateTime has a \"set*\" method for every item that can be passed to the constructor:\n\n•   $dt->setyear\n\n•   $dt->setmonth\n\n•   $dt->setday\n\n•   $dt->sethour\n\n•   $dt->setminute\n\n•   $dt->setsecond\n\n•   $dt->setnanosecond\n\nThese are shortcuts to calling \"set\" with a single key. They all take a single parameter.\n\n$dt->truncate( to => ... )\n\nThis method allows you to reset some of the local time components in the object to their\n\"zero\" values. The \"to\" parameter is used to specify which values to truncate, and it may be\none of \"year\", \"quarter\", \"month\", \"week\", \"localweek\", \"day\", \"hour\", \"minute\", or\n\"second\".\n\nFor example, if \"month\" is specified, then the local day becomes 1, and the hour, minute, and\nsecond all become 0.\n\nIf \"week\" is given, then the datetime is set to the Monday of the week in which it occurs,\nand the time components are all set to 0. If you truncate to \"localweek\", then the first day\nof the week is locale-dependent. For example, in the \"en-US\" locale, the first day of the\nweek is Sunday.\n\n$dt->setlocale($locale)\n\nSets the object's locale. You can provide either a locale code like \"en-US\" or an object\nreturned by \"DateTime::Locale->load\".\n\n$dt->settimezone($tz)\n\nThis method accepts either a time zone object or a string that can be passed as the \"name\"\nparameter to \"DateTime::TimeZone->new\". If the new time zone's offset is different from the\nold time zone, then the local time is adjusted accordingly.\n\nFor example:\n\nmy $dt = DateTime->new(\nyear      => 2000,\nmonth     => 5,\nday       => 10,\nhour      => 15,\nminute    => 15,\ntimezone => 'America/LosAngeles',\n);\n\nprint $dt->hour;    # prints 15\n\n$dt->settimezone('America/Chicago');\n\nprint $dt->hour;    # prints 17\n\nIf the old time zone was a floating time zone, then no adjustments to the local time are\nmade, except to account for leap seconds. If the new time zone is floating, then the UTC time\nis adjusted in order to leave the local time untouched.\n\nFans of Tsai Ming-Liang's films will be happy to know that this does work:\n\nmy $dt = DateTime->now( timezone => 'Asia/Taipei' );\n$dt->settimezone('Europe/Paris');\n\nYes, now we can know \"ni3 na4 bian1 ji2 dian3?\"\n\n$dt->setformatter($formatter)\n\nSets the formatter for the object. See \"Formatters And Stringification\" for details.\n\nYou can set this to \"undef\" to revert to the default formatter.\n"
                    },
                    {
                        "name": "Math Methods",
                        "content": "Like the set methods, math related methods always return the object itself, to allow for\nchaining:\n\n$dt->add( days => 1 )->subtract( seconds => 1 );\n\n$dt->durationclass\n\nThis returns \"DateTime::Duration\", but exists so that a subclass of \"DateTime\" can provide a\ndifferent value.\n\n$dt->addduration($durationobject)\n\nThis method adds a DateTime::Duration to the current datetime. See the DateTime::Duration\ndocs for more details.\n\n$dt->add( parameters for DateTime::Duration )\n\nThis method is syntactic sugar around the \"$dt->addduration\" method. It simply creates a new\nDateTime::Duration object using the parameters given, and then calls the \"$dt->addduration\"\nmethod.\n\n$dt->add($durationobject)\n\nA synonym of \"$dt->addduration($durationobject)\".\n\n$dt->subtractduration($durationobject)\n\nWhen given a DateTime::Duration object, this method simply calls \"$dur->inverse\" on that\nobject and passes that new duration to the \"$self->addduration\" method.\n\n$dt->subtract( DateTime::Duration->new parameters )\n\nLike \"$dt->add\", this is syntactic sugar for the \"$dt->subtractduration\" method.\n\n$dt->subtract($durationobject)\n\nA synonym of \"$dt->subtractduration($durationobject)\".\n\n$dt->subtractdatetime($datetime)\n\nThis method returns a new DateTime::Duration object representing the difference between the\ntwo dates. The duration is relative to the object from which $datetime is subtracted. For\nexample:\n\n2003-03-15 00:00:00.00000000\n-  2003-02-15 00:00:00.00000000\n-------------------------------\n= 1 month\n\nNote that this duration is not an absolute measure of the amount of time between the two\ndatetimes, because the length of a month varies, as well as due to the presence of leap\nseconds.\n\nThe returned duration may have deltas for months, days, minutes, seconds, and nanoseconds.\n\n$dt->deltamd($datetime), $dt->deltadays($datetime)\n\nEach of these methods returns a new DateTime::Duration object representing some portion of\nthe difference between two datetimes.  The \"$dt->deltamd\" method returns a duration which\ncontains only the month and day portions of the duration is represented. The\n\"$dt->deltadays\" method returns a duration which contains only days.\n\nThe \"$dt->deltamd\" and \"$dt->deltadays\" methods truncate the duration so that any\nfractional portion of a day is ignored. Both of these methods operate on the date portion of\na datetime only, and so effectively ignore the time zone.\n\nUnlike the subtraction methods, these methods always return a positive (or zero) duration.\n\n$dt->deltams($datetime)\n\nReturns a duration which contains only minutes and seconds. Any day and month differences are\nconverted to minutes and seconds. This method always returns a positive (or zero) duration.\n\n$dt->subtractdatetimeabsolute($datetime)\n\nThis method returns a new DateTime::Duration object representing the difference between the\ntwo dates in seconds and nanoseconds. This is the only way to accurately measure the absolute\namount of time between two datetimes, since units larger than a second do not represent a\nfixed number of seconds.\n\nNote that because of leap seconds, this may not return the same result as doing this math\nbased on the value returned by \"$dt->epoch\".\n\n$dt->isbetween( $lower, $upper )\n\nChecks whether $dt is strictly between two other DateTime objects.\n\n\"Strictly\" means that $dt must be greater than $lower and less than $upper. If it is equal to\neither object then this method returns false.\n"
                    },
                    {
                        "name": "Class Methods",
                        "content": "DateTime->DefaultLocale($locale)\n\nThis can be used to specify the default locale to be used when creating DateTime objects. If\nunset, then \"en-US\" is used.\n\nThis exists for backwards compatibility, but is probably best avoided. This will change the\ndefault locale for every \"DateTime\" object created in your application, even those created by\nthird party libraries which also use \"DateTime\".\n\nDateTime->compare( $dt1, $dt2 ), DateTime->compareignorefloating( $dt1, $dt2 )\n\n$cmp = DateTime->compare( $dt1, $dt2 );\n\n$cmp = DateTime->compareignorefloating( $dt1, $dt2 );\n\nThis method compare two DateTime objects. The semantics are compatible with Perl's \"sort\"\nfunction; it returns \"-1\" if \"$dt1 < $dt2\", 0 if \"$dt1 == $dt2\", 1 if \"$dt1 > $dt2\".\n\nIf one of the two DateTime objects has a floating time zone, it will first be converted to\nthe time zone of the other object. This is what you want most of the time, but it can lead to\ninconsistent results when you compare a number of DateTime objects, some of which are\nfloating, and some of which are in other time zones.\n\nIf you want to have consistent results (because you want to sort an array of objects, for\nexample), you can use the \"compareignorefloating\" method:\n\n@dates = sort { DateTime->compareignorefloating( $a, $b ) } @dates;\n\nIn this case, objects with a floating time zone will be sorted as if they were UTC times.\n\nSince DateTime objects overload comparison operators, this:\n\n@dates = sort @dates;\n\nis equivalent to this:\n\n@dates = sort { DateTime->compare( $a, $b ) } @dates;\n\nDateTime objects can be compared to any other calendar class that implements the\n\"utcrdvalues\" method.\n"
                    },
                    {
                        "name": "Testing Code That Uses DateTime",
                        "content": "If you are trying to test code that calls uses DateTime, you may want to be to explicitly set\nthe value returned by Perl's \"time\" builtin. This builtin is called by \"DateTime->now\" and\n\"DateTime->today\".\n\nYou can override \"CORE::GLOBAL::time\", but this will only work if you do this before loading\nDateTime. If doing this is inconvenient, you can also override \"DateTime::coretime\":\n\nno warnings 'redefine';\nlocal *DateTime::coretime = sub { return 42 };\n\nDateTime is guaranteed to call this subroutine to get the current \"time\" value. You can also\noverride the \"coretime\" sub in a subclass of DateTime and use that.\n"
                    },
                    {
                        "name": "How DateTime Math Works",
                        "content": "It's important to have some understanding of how datetime math is implemented in order to\neffectively use this module and DateTime::Duration.\n\nMaking Things Simple\n\nIf you want to simplify your life and not have to think too hard about the nitty-gritty of\ndatetime math, I have several recommendations:\n\n•   use the floating time zone\n\nIf you do not care about time zones or leap seconds, use the \"floating\" timezone:\n\nmy $dt = DateTime->now( timezone => 'floating' );\n\nMath done on two objects in the floating time zone produces very predictable results.\n\nNote that in most cases you will want to start by creating an object in a specific zone\nand then convert it to the floating time zone. When an object goes from a real zone to\nthe floating zone, the time for the object remains the same.\n\nThis means that passing the floating zone to a constructor may not do what you want.\n\nmy $dt = DateTime->now( timezone => 'floating' );\n\nis equivalent to\n\nmy $dt = DateTime->now( timezone => 'UTC' )->settimezone('floating');\n\nThis might not be what you wanted. Instead, you may prefer to do this:\n\nmy $dt = DateTime->now( timezone => 'local' )->settimezone('floating');\n\n•   use UTC for all calculations\n\nIf you do care about time zones (particularly DST) or leap seconds, try to use non-UTC\ntime zones for presentation and user input only. Convert to UTC immediately and convert\nback to the local time zone for presentation:\n\nmy $dt = DateTime->new( %userinput, timezone => $usertz );\n$dt->settimezone('UTC');\n\n# do various operations - store it, retrieve it, add, subtract, etc.\n\n$dt->settimezone($usertz);\nprint $dt->datetime;\n\n•   math on non-UTC time zones\n\nIf you need to do date math on objects with non-UTC time zones, please read the caveats\nbelow carefully. The results \"DateTime\" produces are predictable, correct, and mostly\nintuitive, but datetime math gets very ugly when time zones are involved, and there are a\nfew strange corner cases involving subtraction of two datetimes across a DST change.\n\nIf you can always use the floating or UTC time zones, you can skip ahead to \"Leap Seconds\nand Date Math\"\n\n•   date vs datetime math\n\nIf you only care about the date (calendar) portion of a datetime, you should use either\n\"$dt->deltamd\" or \"$dt->deltadays\", not \"$dt->subtractdatetime\". This will give\npredictable, unsurprising results, free from DST-related complications.\n\n•   $dt->subtractdatetime and $dt->addduration\n\nYou must convert your datetime objects to the UTC time zone before doing date math if you\nwant to make sure that the following formulas are always true:\n\n$dt2 - $dt1 = $dur\n$dt1 + $dur = $dt2\n$dt2 - $dur = $dt1\n\nNote that using \"$dt->deltadays\" ensures that this formula always works, regardless of\nthe time zones of the objects involved, as does using \"$dt->subtractdatetimeabsolute\".\nOther methods of subtraction are not always reversible.\n\n•   never do math on two objects where only one is in the floating time zone\n\nThe date math code accounts for leap seconds whenever the \"DateTime\" object is not in the\nfloating time zone. If you try to do math where one object is in the floating zone and\nthe other isn't, the results will be confusing and wrong.\n\nAdding a Duration to a DateTime\n\nThe parts of a duration can be broken down into five parts. These are months, days, minutes,\nseconds, and nanoseconds. Adding one month to a date is different than adding 4 weeks or 28,\n29, 30, or 31 days.  Similarly, due to DST and leap seconds, adding a day can be different\nthan adding 86,400 seconds, and adding a minute is not exactly the same as 60 seconds.\n\nWe cannot convert between these units, except for seconds and nanoseconds, because there is\nno fixed conversion between most pairs of units. That is because of things like leap seconds,\nDST changes, etc.\n\n\"DateTime\" always adds (or subtracts) days, then months, minutes, and then seconds and\nnanoseconds. If there are any boundary overflows, these are normalized at each step. For the\ndays and months the local (not UTC) values are used. For minutes and seconds, the local\nvalues are used. This generally just works.\n\nThis means that adding one month and one day to February 28, 2003 will produce the date April\n1, 2003, not March 29, 2003.\n\nmy $dt = DateTime->new( year => 2003, month => 2, day => 28 );\n\n$dt->add( months => 1, days => 1 );\n\n# 2003-04-01 - the result\n\nOn the other hand, if we add months first, and then separately add days, we end up with March\n29, 2003:\n\n$dt->add( months => 1 )->add( days => 1 );\n\n# 2003-03-29\n\nWe see similar strangeness when math crosses a DST boundary:\n\nmy $dt = DateTime->new(\nyear      => 2003,\nmonth     => 4,\nday       => 5,\nhour      => 1,\nminute    => 58,\ntimezone => \"America/Chicago\",\n);\n\n$dt->add( days => 1, minutes => 3 );\n# 2003-04-06 02:01:00\n\n$dt->add( minutes => 3 )->add( days => 1 );\n# 2003-04-06 03:01:00\n\nNote that if you converted the datetime object to UTC first you would get predictable\nresults.\n\nIf you want to know how many seconds a DateTime::Duration object represents, you have to add\nit to a datetime to find out, so you could do:\n\nmy $now   = DateTime->now( timezone => 'UTC' );\nmy $later = $now->clone->addduration($duration);\n\nmy $secondsdur = $later->subtractdatetimeabsolute($now);\n\nThis returns a DateTime::Duration which only contains seconds and nanoseconds.\n\nIf we were add the duration to a different \"DateTime\" object we might get a different number\nof seconds.\n\nDateTime::Duration supports three different end-of-month algorithms for adding months. This\ncomes into play when an addition results in a day past the end of the following month (for\nexample, adding one month to January 30).\n\n# 2010-08-31 + 1 month = 2010-10-01\n$dt->add( months => 1, endofmonth => 'wrap' );\n\n# 2010-01-30 + 1 month = 2010-02-28\n$dt->add( months => 1, endofmonth => 'limit' );\n\n# 2010-04-30 + 1 month = 2010-05-31\n$dt->add( months => 1, endofmonth => 'preserve' );\n\nBy default, it uses \"wrap\" for positive durations and \"preserve\" for negative durations. See\nDateTime::Duration for a detailed explanation of these algorithms.\n\nIf you need to do lots of work with durations, take a look at the DateTime::Format::Duration\nmodule, which lets you present information from durations in many useful ways.\n\nThere are other subtract/delta methods in \"DateTime\" to generate different types of\ndurations. These methods are \"$dt->subtractdatetime\", \"$dt->subtractdatetimeabsolute\",\n\"$dt->deltamd\", \"$dt->deltadays\", and \"$dt->deltams\".\n\nDateTime Subtraction\n\nDate subtraction is done based solely on the two object's local datetimes, with one exception\nto handle DST changes. Also, if the two datetime objects are in different time zones, one of\nthem is converted to the other's time zone first before subtraction. This is best explained\nthrough examples:\n\nThe first of these probably makes the most sense:\n\n# not DST\nmy $dt1 = DateTime->new(\nyear      => 2003,\nmonth     => 5,\nday       => 6,\ntimezone => 'America/Chicago',\n);\n\n# is DST\nmy $dt2 = DateTime->new(\nyear      => 2003,\nmonth     => 11,\nday       => 6,\ntimezone => 'America/Chicago',\n);\n\n# 6 months\nmy $dur = $dt2->subtractdatetime($dt1);\n\nNice and simple.\n\nThis one is a little trickier, but still fairly logical:\n\n# is DST\nmy $dt1 = DateTime->new(\nyear      => 2003,\nmonth     => 4,\nday       => 5,\nhour      => 1,\nminute    => 58,\ntimezone => \"America/Chicago\",\n);\n\n# not DST\nmy $dt2 = DateTime->new(\nyear      => 2003,\nmonth     => 4,\nday       => 7,\nhour      => 2,\nminute    => 1,\ntimezone => \"America/Chicago\",\n);\n\n# 2 days and 3 minutes\nmy $dur = $dt2->subtractdatetime($dt1);\n\nWhich contradicts the result this one gives, even though they both make sense:\n\n# is DST\nmy $dt1 = DateTime->new(\nyear      => 2003,\nmonth     => 4,\nday       => 5,\nhour      => 1,\nminute    => 58,\ntimezone => \"America/Chicago\",\n);\n\n# not DST\nmy $dt2 = DateTime->new(\nyear      => 2003,\nmonth     => 4,\nday       => 6,\nhour      => 3,\nminute    => 1,\ntimezone => \"America/Chicago\",\n);\n\n# 1 day and 3 minutes\nmy $dur = $dt2->subtractdatetime($dt1);\n\nThis last example illustrates the \"DST\" exception mentioned earlier. The exception accounts\nfor the fact 2003-04-06 only lasts 23 hours.\n\nAnd finally:\n\nmy $dt2 = DateTime->new(\nyear      => 2003,\nmonth     => 10,\nday       => 26,\nhour      => 1,\ntimezone => 'America/Chicago',\n);\n\nmy $dt1 = $dt2->clone->subtract( hours => 1 );\n\n# 60 minutes\nmy $dur = $dt2->subtractdatetime($dt1);\n\nThis seems obvious until you realize that subtracting 60 minutes from $dt2 in the above\nexample still leaves the clock time at \"01:00:00\". This time we are accounting for a 25 hour\nday.\n\nReversibility\n\nDate math operations are not always reversible. This is because of the way that addition\noperations are ordered. As was discussed earlier, adding 1 day and 3 minutes in one call to\n\"$dt->add\" is not the same as first adding 3 minutes and 1 day in two separate calls.\n\nIf we take a duration returned from \"$dt->subtractdatetime\" and then try to add or subtract\nthat duration from one of the datetimes we just used, we sometimes get interesting results:\n\nmy $dt1 = DateTime->new(\nyear      => 2003,\nmonth     => 4,\nday       => 5,\nhour      => 1,\nminute    => 58,\ntimezone => \"America/Chicago\",\n);\n\nmy $dt2 = DateTime->new(\nyear      => 2003,\nmonth     => 4,\nday       => 6,\nhour      => 3,\nminute    => 1,\ntimezone => \"America/Chicago\",\n);\n\n# 1 day and 3 minutes\nmy $dur = $dt2->subtractdatetime($dt1);\n\n# gives us $dt2\n$dt1->addduration($dur);\n\n# gives us 2003-04-05 02:58:00 - 1 hour later than $dt1\n$dt2->subtractduration($dur);\n\nThe \"$dt->subtractduration\" operation gives us a (perhaps) unexpected answer because it\nfirst subtracts one day to get 2003-04-05T03:01:00 and then subtracts 3 minutes to get the\nfinal result.\n\nIf we explicitly reverse the order we can get the original value of $dt1.  This can be\nfacilitated by the DateTime::Duration class's \"$dur->calendarduration\" and\n\"$dur->clockduration\" methods:\n\n$dt2->subtractduration( $dur->clockduration )\n->subtractduration( $dur->calendarduration );\n\nLeap Seconds and Date Math\n\nThe presence of leap seconds can cause even more anomalies in date math. For example, the\nfollowing is a legal datetime:\n\nmy $dt = DateTime->new(\nyear      => 1972,\nmonth     => 12,\nday       => 31,\nhour      => 23,\nminute    => 59,\nsecond    => 60,\ntimezone => 'UTC'\n);\n\nIf we add one month ...\n\n$dt->add( months => 1 );\n\n... the datetime is now \"1973-02-01 00:00:00\", because there is no 23:59:60 on 1973-01-31.\n\nLeap seconds also force us to distinguish between minutes and seconds during date math. Given\nthe following datetime ...\n\nmy $dt = DateTime->new(\nyear      => 1972,\nmonth     => 12,\nday       => 31,\nhour      => 23,\nminute    => 59,\nsecond    => 30,\ntimezone => 'UTC'\n);\n\n... we will get different results when adding 1 minute than we get if we add 60 seconds. This\nis because in this case, the last minute of the day, beginning at 23:59:00, actually contains\n61 seconds.\n\nHere are the results we get:\n\n# 1972-12-31 23:59:30 - our starting datetime\nmy $dt = DateTime->new(\nyear      => 1972,\nmonth     => 12,\nday       => 31,\nhour      => 23,\nminute    => 59,\nsecond    => 30,\ntimezone => 'UTC'\n);\n\n# 1973-01-01 00:00:30 - one minute later\n$dt->clone->add( minutes => 1 );\n\n# 1973-01-01 00:00:29 - 60 seconds later\n$dt->clone->add( seconds => 60 );\n\n# 1973-01-01 00:00:30 - 61 seconds later\n$dt->clone->add( seconds => 61 );\n\nLocal vs. UTC and 24 hours vs. 1 day\n\nWhen math crosses a daylight saving boundary, a single day may have more or less than 24\nhours.\n\nFor example, if you do this ...\n\nmy $dt = DateTime->new(\nyear      => 2003,\nmonth     => 4,\nday       => 5,\nhour      => 2,\ntimezone => 'America/Chicago',\n);\n\n$dt->add( days => 1 );\n\n... then you will produce an invalid local time, and therefore an exception will be thrown.\n\nHowever, this works ...\n\nmy $dt = DateTime->new(\nyear      => 2003,\nmonth     => 4,\nday       => 5,\nhour      => 2,\ntimezone => 'America/Chicago',\n);\n\n$dt->add( hours => 24 );\n\n... and produces a datetime with the local time of \"03:00\".\n\nIf all this makes your head hurt, there is a simple alternative. Just convert your datetime\nobject to the \"UTC\" time zone before doing date math on it, and switch it back to the local\ntime zone afterwards. This avoids the possibility of having date math throw an exception, and\nmakes sure that 1 day equals 24 hours. Of course, this may not always be desirable, so caveat\nuser!\n"
                    },
                    {
                        "name": "Overloading",
                        "content": "This module explicitly overloads the addition (+), subtraction (-), string and numeric\ncomparison operators. This means that the following all do sensible things:\n\nmy $newdt = $dt + $durationobj;\n\nmy $newdt = $dt - $durationobj;\n\nmy $durationobj = $dt - $newdt;\n\nfor my $dt ( sort @dts ) {...}\n\nAdditionally, the fallback parameter is set to true, so other derivable operators (+=, -=,\netc.) will work properly. Do not expect increment (++) or decrement (--) to do anything\nuseful.\n\nThe string comparison operators, \"eq\" or \"ne\", will use the string value to compare with non-\nDateTime objects.\n\nDateTime objects do not have a numeric value, using \"==\" or \"<=>\" to compare a DateTime\nobject with a non-DateTime object will result in an exception. To safely sort mixed DateTime\nand non-DateTime objects, use \"sort { $a cmp $b } @dates\".\n\nThe module also overloads stringification using the object's formatter, defaulting to\n\"iso8601\" method. See \"Formatters And Stringification\" for details.\n"
                    },
                    {
                        "name": "Formatters And Stringification",
                        "content": "You can optionally specify a \"formatter\", which is usually a \"DateTime::Format::*\" object or\nclass, to control the stringification of the DateTime object.\n\nAny of the constructor methods can accept a formatter argument:\n\nmy $formatter = DateTime::Format::Strptime->new(...);\nmy $dt        = DateTime->new( year => 2004, formatter => $formatter );\n\nOr, you can set it afterwards:\n\n$dt->setformatter($formatter);\n$formatter = $dt->formatter;\n\nOnce you set the formatter, the overloaded stringification method will use the formatter. If\nunspecified, the \"iso8601\" method is used.\n\nA formatter can be handy when you know that in your application you want to stringify your\nDateTime objects into a special format all the time, for example in Postgres format.\n\nIf you provide a formatter class name or object, it must implement a \"formatdatetime\"\nmethod. This method will be called with just the \"DateTime\" object as its argument.\n"
                    },
                    {
                        "name": "CLDR Patterns",
                        "content": "The CLDR pattern language is both more powerful and more complex than strftime.  Unlike\nstrftime patterns, you often have to explicitly escape text that you do not want formatted,\nas the patterns are simply letters without any prefix.\n\nFor example, \"yyyy-MM-dd\" is a valid CLDR pattern. If you want to include any lower or upper\ncase ASCII characters as-is, you can surround them with single quotes ('). If you want to\ninclude a single quote, you must escape it as two single quotes ('').\n\nmy $pattern1 = q{'Today is ' EEEE};\nmy $pattern2 = q{'It is now' h 'o''clock' a};\n\nSpaces and any non-letter text will always be passed through as-is.\n\nMany CLDR patterns which produce numbers will pad the number with leading zeroes depending on\nthe length of the format specifier. For example, \"h\" represents the current hour from 1-12.\nIf you specify \"hh\" then hours 1-9 will have a leading zero prepended.\n\nHowever, CLDR often uses five of a letter to represent the narrow form of a pattern. This\ninconsistency is necessary for backwards compatibility.\n\nThere are many cases where CLDR patterns distinguish between the \"format\" and \"stand-alone\"\nforms of a pattern. The format pattern is used when the thing in question is being placed\ninto a larger string. The stand-alone form is used when displaying that item by itself, for\nexample in a calendar.\n\nThere are also many cases where CLDR provides three sizes for each item, wide (the full\nname), abbreviated, and narrow. The narrow form is often just a single character, for example\n\"T\" for \"Tuesday\", and may not be unique.\n\nCLDR provides a fairly complex system for localizing time zones that we ignore entirely. The\ntime zone patterns just use the information provided by \"DateTime::TimeZone\", and do not\nfollow the CLDR spec.\n\nThe output of a CLDR pattern is always localized, when applicable.\n\nCLDR provides the following patterns:\n\n•   G{1,3}\n\nThe abbreviated era (BC, AD).\n\n•   GGGG\n\nThe wide era (Before Christ, Anno Domini).\n\n•   GGGGG\n\nThe narrow era, if it exists (but it mostly doesn't).\n\n•   y and y{3,}\n\nThe year, zero-prefixed as needed. Negative years will start with a \"-\", and this will be\nincluded in the length calculation.\n\nIn other, words the \"yyyyy\" pattern will format year -1234 as \"-1234\", not \"-01234\".\n\n•   yy\n\nThis is a special case. It always produces a two-digit year, so \"1976\" becomes \"76\".\nNegative years will start with a \"-\", making them one character longer.\n\n•   Y{1,}\n\nThe year in \"week of the year\" calendars, from \"$dt->weekyear\".\n\n•   u{1,}\n\nSame as \"y\" except that \"uu\" is not a special case.\n\n•   Q{1,2}\n\nThe quarter as a number (1..4).\n\n•   QQQ\n\nThe abbreviated format form for the quarter.\n\n•   QQQQ\n\nThe wide format form for the quarter.\n\n•   q{1,2}\n\nThe quarter as a number (1..4).\n\n•   qqq\n\nThe abbreviated stand-alone form for the quarter.\n\n•   qqqq\n\nThe wide stand-alone form for the quarter.\n\n•   M{1,2}\n\nThe numerical month.\n\n•   MMM\n\nThe abbreviated format form for the month.\n\n•   MMMM\n\nThe wide format form for the month.\n\n•   MMMMM\n\nThe narrow format form for the month.\n\n•   L{1,2}\n\nThe numerical month.\n\n•   LLL\n\nThe abbreviated stand-alone form for the month.\n\n•   LLLL\n\nThe wide stand-alone form for the month.\n\n•   LLLLL\n\nThe narrow stand-alone form for the month.\n\n•   w{1,2}\n\nThe week of the year, from \"$dt->weeknumber\".\n\n•   W\n\nThe week of the month, from \"$dt->weekofmonth\".\n\n•   d{1,2}\n\nThe numeric day of the month.\n\n•   D{1,3}\n\nThe numeric day of the year.\n\n•   F\n\nThe day of the week in the month, from \"$dt->weekdayofmonth\".\n\n•   g{1,}\n\nThe modified Julian day, from \"$dt->mjd\".\n\n•   E{1,3} and eee\n\nThe abbreviated format form for the day of the week.\n\n•   EEEE and eeee\n\nThe wide format form for the day of the week.\n\n•   EEEEE and eeeee\n\nThe narrow format form for the day of the week.\n\n•   e{1,2}\n\nThe local numeric day of the week, from 1 to 7. This number depends on what day is\nconsidered the first day of the week, which varies by locale. For example, in the US,\nSunday is the first day of the week, so this returns 2 for Monday.\n\n•   c\n\nThe numeric day of the week from 1 to 7, treating Monday as the first of the week,\nregardless of locale.\n\n•   ccc\n\nThe abbreviated stand-alone form for the day of the week.\n\n•   cccc\n\nThe wide stand-alone form for the day of the week.\n\n•   ccccc\n\nThe narrow format form for the day of the week.\n\n•   a\n\nThe localized form of AM or PM for the time.\n\n•   h{1,2}\n\nThe hour from 1-12.\n\n•   H{1,2}\n\nThe hour from 0-23.\n\n•   K{1,2}\n\nThe hour from 0-11.\n\n•   k{1,2}\n\nThe hour from 1-24.\n\n•   j{1,2}\n\nThe hour, in 12 or 24 hour form, based on the preferred form for the locale. In other\nwords, this is equivalent to either \"h{1,2}\" or \"H{1,2}\".\n\n•   m{1,2}\n\nThe minute.\n\n•   s{1,2}\n\nThe second.\n\n•   S{1,}\n\nThe fractional portion of the seconds, rounded based on the length of the specifier. This\nreturned without a leading decimal point, but may have leading or trailing zeroes.\n\n•   A{1,}\n\nThe millisecond of the day, based on the current time. In other words, if it is\n12:00:00.00, this returns 43200000.\n\n•   z{1,3}\n\nThe time zone short name.\n\n•   zzzz\n\nThe time zone long name.\n\n•   Z{1,3}\n\nThe time zone offset.\n\n•   ZZZZ\n\nThe time zone short name and the offset as one string, so something like \"CDT-0500\".\n\n•   ZZZZZ\n\nThe time zone offset as a sexagesimal number, so something like \"-05:00\". (This is useful\nfor W3C format.)\n\n•   v{1,3}\n\nThe time zone short name.\n\n•   vvvv\n\nThe time zone long name.\n\n•   V{1,3}\n\nThe time zone short name.\n\n•   VVVV\n\nThe time zone long name.\n\nCLDR \"Available Formats\"\n\nThe CLDR data includes pre-defined formats for various patterns such as \"month and day\" or\n\"time of day\". Using these formats lets you render information about a datetime in the most\nnatural way for users from a given locale.\n\nThese formats are indexed by a key that is itself a CLDR pattern. When you look these up, you\nget back a different CLDR pattern suitable for the locale.\n\nLet's look at some example We'll use \"2008-02-05T18:30:30\" as our example datetime value, and\nsee how this is rendered for the \"en-US\" and \"fr-FR\" locales.\n\n•   \"MMMd\"\n\nThe abbreviated month and day as number. For \"en-US\", we get the pattern \"MMM d\", which\nrenders as \"Feb 5\". For \"fr-FR\", we get the pattern \"d MMM\", which renders as \"5 févr.\".\n\n•   \"yQQQ\"\n\nThe year and abbreviated quarter of year. For \"en-US\", we get the pattern \"QQQ y\", which\nrenders as \"Q1 2008\". For \"fr-FR\", we get the same pattern, \"QQQ y\", which renders as \"T1\n2008\".\n\n•   \"hm\"\n\nThe 12-hour time of day without seconds. For \"en-US\", we get the pattern \"h:mm a\", which\nrenders as \"6:30 PM\". For \"fr-FR\", we get the exact same pattern and rendering.\n\nThe available formats for each locale are documented in the POD for that locale. To get back\nthe format, you use the \"$locale->formatfor\" method.  For example:\n\nsay $dt->formatcldr( $dt->locale->formatfor('MMMd') );\n"
                    },
                    {
                        "name": "strftime Patterns",
                        "content": "The following patterns are allowed in the format string given to the \"$dt->strftime\" method:\n\n•   %a\n\nThe abbreviated weekday name.\n\n•   %A\n\nThe full weekday name.\n\n•   %b\n\nThe abbreviated month name.\n\n•   %B\n\nThe full month name.\n\n•   %c\n\nThe default datetime format for the object's locale.\n\n•   %C\n\nThe century number (year/100) as a 2-digit integer.\n\n•   %d\n\nThe day of the month as a decimal number (range 01 to 31).\n\n•   %D\n\nEquivalent to %m/%d/%y. This is not a good standard format if you want folks from both\nthe United States and the rest of the world to understand the date!\n\n•   %e\n\nLike %d, the day of the month as a decimal number, but a leading zero is replaced by a\nspace.\n\n•   %F\n\nEquivalent to %Y-%m-%d (the ISO 8601 date format)\n\n•   %G\n\nThe ISO 8601 year with century as a decimal number. The 4-digit year corresponding to the\nISO week number (see %V). This has the same format and value as %Y, except that if the\nISO week number belongs to the previous or next year, that year is used instead. (TZ)\n\n•   %g\n\nLike %G, but without century, i.e., with a 2-digit year (00-99).\n\n•   %h\n\nEquivalent to %b.\n\n•   %H\n\nThe hour as a decimal number using a 24-hour clock (range 00 to 23).\n\n•   %I\n\nThe hour as a decimal number using a 12-hour clock (range 01 to 12).\n\n•   %j\n\nThe day of the year as a decimal number (range 001 to 366).\n\n•   %k\n\nThe hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded\nby a blank. (See also %H.)\n\n•   %l\n\nThe hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded\nby a blank. (See also %I.)\n\n•   %m\n\nThe month as a decimal number (range 01 to 12).\n\n•   %M\n\nThe minute as a decimal number (range 00 to 59).\n\n•   %n\n\nA newline character.\n\n•   %N\n\nThe fractional seconds digits. Default is 9 digits (nanoseconds).\n\n%3N   milliseconds (3 digits)\n%6N   microseconds (6 digits)\n%9N   nanoseconds  (9 digits)\n\nThis value will always be rounded down to the nearest integer.\n\n•   %p\n\nEither `AM' or `PM' according to the given time value, or the corresponding strings for\nthe current locale. Noon is treated as `pm' and midnight as `am'.\n\n•   %P\n\nLike %p but in lowercase: `am' or `pm' or a corresponding string for the current locale.\n\n•   %r\n\nThe time in a.m. or p.m. notation. In the POSIX locale this is equivalent to `%I:%M:%S\n%p'.\n\n•   %R\n\nThe time in 24-hour notation (%H:%M). (SU) For a version including the seconds, see %T\nbelow.\n\n•   %s\n\nThe number of seconds since the epoch.\n\n•   %S\n\nThe second as a decimal number (range 00 to 61).\n\n•   %t\n\nA tab character.\n\n•   %T\n\nThe time in 24-hour notation (%H:%M:%S).\n\n•   %u\n\nThe day of the week as a decimal, range 1 to 7, Monday being 1. See also %w.\n\n•   %U\n\nThe week number of the current year as a decimal number, range 00 to 53, starting with\nthe first Sunday as the first day of week 01. See also %V and %W.\n\n•   %V\n\nThe ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53,\nwhere week 1 is the first week that has at least 4 days in the current year, and with\nMonday as the first day of the week. See also %U and %W.\n\n•   %w\n\nThe day of the week as a decimal, range 0 to 6, Sunday being 0. See also %u.\n\n•   %W\n\nThe week number of the current year as a decimal number, range 00 to 53, starting with\nthe first Monday as the first day of week 01.\n\n•   %x\n\nThe default date format for the object's locale.\n\n•   %X\n\nThe default time format for the object's locale.\n\n•   %y\n\nThe year as a decimal number without a century (range 00 to 99).\n\n•   %Y\n\nThe year as a decimal number including the century.\n\n•   %z\n\nThe time-zone as hour offset from UTC. Required to emit RFC822-conformant dates (using\n\"%a, %d %b %Y %H:%M:%S %z\").\n\n•   %Z\n\nThe short name for the time zone, typically an abbreviation like \"EST\" or \"AEST\".\n\n•   %%\n\nA literal `%' character.\n\n•   %{method}\n\nAny method name may be specified using the format \"%{method}\" name where \"method\" is a\nvalid \"DateTime\" object method.\n"
                    },
                    {
                        "name": "DateTime and Storable",
                        "content": "\"DateTime\" implements Storable hooks in order to reduce the size of a serialized \"DateTime\"\nobject.\n"
                    }
                ]
            },
            "DEVELOPMENT TOOLS": {
                "content": "If you're working on the \"DateTIme\" code base, there are a few extra non-Perl tools that you\nmay find useful, notably precious <https://github.com/houseabsolute/precious>, a\nmeta-linter/tidier.  You can install all the necessary tools in \"$HOME/bin\" by running\n./dev-bin/install-dev-tools.sh.\n\nTry running \"precious tidy -a\" to tidy all the tidyable files in the repo, and \"precious lint\n-a\" to run all the lint checks.\n\nYou can enable a git pre-commit hook for linting by running ./git/setup.pl.\n\nNote that linting will be checked in CI, and it's okay to submit a PR which fails the linting\ncheck, but it's extra nice to fix these yourself.\n",
                "subsections": []
            },
            "THE DATETIME PROJECT ECOSYSTEM": {
                "content": "This module is part of a larger ecosystem of modules in the DateTime family.\n",
                "subsections": [
                    {
                        "name": "DateTime::Set",
                        "content": "The DateTime::Set module represents sets (including recurrences) of datetimes. Many modules\nreturn sets or recurrences.\n"
                    },
                    {
                        "name": "Format Modules",
                        "content": "The various format modules exist to parse and format datetimes. For example,\nDateTime::Format::HTTP parses dates according to the RFC 1123 format:\n\nmy $datetime\n= DateTime::Format::HTTP->parsedatetime(\n'Thu Feb  3 17:03:55 GMT 1994');\n\nprint DateTime::Format::HTTP->formatdatetime($datetime);\n\nMost format modules are suitable for use as a \"formatter\" with a DateTime object.\n\nAll format modules start with DateTime::Format::\n<https://metacpan.org/search?q=datetime%3A%3Aformat>.\n"
                    },
                    {
                        "name": "Calendar Modules",
                        "content": "There are a number of modules on CPAN that implement non-Gregorian calendars, such as the\nChinese, Mayan, and Julian calendars.\n\nAll calendar modules start with DateTime::Calendar::\n<https://metacpan.org/search?q=datetime%3A%3Acalendar>.\n"
                    },
                    {
                        "name": "Event Modules",
                        "content": "There are a number of modules that calculate the dates for events, such as Easter, Sunrise,\netc.\n\nAll event modules start with DateTime::Event::\n<https://metacpan.org/search?q=datetime%3A%3Aevent>.\n"
                    },
                    {
                        "name": "Others",
                        "content": "There are many other modules that work with DateTime, including modules in the DateTimeX\nnamespace <https://metacpan.org/search?q=datetimex> namespace, as well as others.\n\nSee MetaCPAN <https://metacpan.org/search?q=datetime> for more modules.\n"
                    }
                ]
            },
            "KNOWN BUGS": {
                "content": "The tests in 20infinite.t seem to fail on some machines, particularly on Win32. This appears\nto be related to Perl's internal handling of IEEE infinity and NaN, and seems to be highly\nplatform/compiler/phase of moon dependent.\n\nIf you don't plan to use infinite datetimes you can probably ignore this. This will be fixed\n(perhaps) in future versions.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "A Date with Perl <http://presentations.houseabsolute.com/a-date-with-perl/> - a talk I've\ngiven at a few YAPCs.\n\ndatetime@perl.org mailing list <http://lists.perl.org/list/datetime.html>\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "Bugs may be submitted at <https://github.com/houseabsolute/DateTime.pm/issues>.\n\nThere is a mailing list available for users of this distribution, <mailto:datetime@perl.org>.\n",
                "subsections": []
            },
            "SOURCE": {
                "content": "The source code repository for DateTime can be found at\n<https://github.com/houseabsolute/DateTime.pm>.\n",
                "subsections": []
            },
            "DONATIONS": {
                "content": "If you'd like to thank me for the work I've done on this module, please consider making a\n\"donation\" to me via PayPal. I spend a lot of free time creating free software, and would\nappreciate any support you'd care to offer.\n\nPlease note that I am not suggesting that you must do this in order for me to continue\nworking on this particular software. I will continue to do so, inasmuch as I have in the\npast, for as long as it interests me.\n\nSimilarly, a donation made in this way will probably not make me work on this software much\nmore, unless I get so many donations that I can consider working on free software full time\n(let's all have a chuckle at that together).\n\nTo donate, log into PayPal and send money to autarch@urth.org, or use the button at\n<https://www.urth.org/fs-donation.html>.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Dave Rolsky <autarch@urth.org>\n",
                "subsections": []
            },
            "CONTRIBUTORS": {
                "content": "•   Ben Bennett <fiji@limey.net>\n\n•   Christian Hansen <chansen@cpan.org>\n\n•   Daisuke Maki <dmaki@cpan.org>\n\n•   Dan Book <grinnz@gmail.com>\n\n•   Dan Stewart <danielandrewstewart@gmail.com>\n\n•   David Dyck <david.dyck@checksum.com>\n\n•   David E. Wheeler <david@justatheory.com>\n\n•   David Precious <davidp@preshweb.co.uk>\n\n•   Doug Bell <madcityzen@gmail.com>\n\n•   Flávio Soibelmann Glock <fglock@gmail.com>\n\n•   Gianni Ceccarelli <gianni.ceccarelli@broadbean.com>\n\n•   Gregory Oschwald <oschwald@gmail.com>\n\n•   Hauke D <haukex@zero-g.net>\n\n•   Iain Truskett <deceased>\n\n•   Jason McIntosh <jmac@jmac.org>\n\n•   Joshua Hoblitt <jhoblitt@cpan.org>\n\n•   Karen Etheridge <ether@cpan.org>\n\n•   Mark Overmeer <mark@overmeer.net>\n\n•   Michael Conrad <mike@nrdvana.net>\n\n•   Michael R. Davis <mrdvt92@users.noreply.github.com>\n\n•   Mohammad S Anwar <mohammad.anwar@yahoo.com>\n\n•   M Somerville <dracos@users.noreply.github.com>\n\n•   Nick Tonkin <1nickt@users.noreply.github.com>\n\n•   Olaf Alders <olaf@wundersolutions.com>\n\n•   Ovid <curtisovidpoe@yahoo.com>\n\n•   Paul Howarth <paul@city-fan.org>\n\n•   Philippe Bruhat (BooK) <book@cpan.org>\n\n•   philip r brenan <philiprbrenan@gmail.com>\n\n•   Ricardo Signes <rjbs@cpan.org>\n\n•   Richard Bowen <bowen@cpan.org>\n\n•   Ron Hill <rkhill@cpan.org>\n\n•   Sam Kington <github@illuminated.co.uk>\n\n•   viviparous <viviparous@prc>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is Copyright (c) 2003 - 2021 by Dave Rolsky.\n\nThis is free software, licensed under:\n\nThe Artistic License 2.0 (GPL Compatible)\n\nThe full text of the license can be found in the LICENSE file included with this\ndistribution.\n\n\n\nperl v5.34.0                                 2022-02-06                                DateTime(3pm)",
                "subsections": []
            }
        }
    }
}