{
    "content": [
        {
            "type": "text",
            "text": "# HTTP::Date (perldoc)\n\n## NAME\n\nHTTP::Date - HTTP::Date - date conversion routines\n\n## SYNOPSIS\n\nuse HTTP::Date;\n$string = time2str($time);    # Format as GMT ASCII time\n$time = str2time($string);    # convert ASCII date to machine time\n\n## DESCRIPTION\n\nThis module provides functions that deal the date formats used by the HTTP protocol (and then\nsome more). Only the first two functions, time2str() and str2time(), are exported by default.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION** (5 subsections)\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "HTTP::Date",
        "section": "",
        "mode": "perldoc",
        "summary": "HTTP::Date - HTTP::Date - date conversion routines",
        "synopsis": "use HTTP::Date;\n$string = time2str($time);    # Format as GMT ASCII time\n$time = str2time($string);    # convert ASCII date to machine time",
        "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": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": [
                    {
                        "name": "time2str",
                        "lines": 10
                    },
                    {
                        "name": "str2time",
                        "lines": 13
                    },
                    {
                        "name": "parse_date",
                        "lines": 47
                    },
                    {
                        "name": "time2iso",
                        "lines": 3
                    },
                    {
                        "name": "time2isoz",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "HTTP::Date - HTTP::Date - date conversion routines\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 6.05\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use HTTP::Date;\n\n$string = time2str($time);    # Format as GMT ASCII time\n$time = str2time($string);    # convert ASCII date to machine time\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides functions that deal the date formats used by the HTTP protocol (and then\nsome more). Only the first two functions, time2str() and str2time(), are exported by default.\n",
                "subsections": [
                    {
                        "name": "time2str",
                        "content": "The time2str() function converts a machine time (seconds since epoch) to a string. If the\nfunction is called without an argument or with an undefined argument, it will use the\ncurrent time.\n\nThe string returned is in the format preferred for the HTTP protocol. This is a fixed length\nsubset of the format defined by RFC 1123, represented in Universal Time (GMT). An example of\na time stamp in this format is:\n\nSun, 06 Nov 1994 08:49:37 GMT\n"
                    },
                    {
                        "name": "str2time",
                        "content": "The str2time() function converts a string to machine time. It returns \"undef\" if the format\nof $str is unrecognized, otherwise whatever the \"Time::Local\" functions can make out of the\nparsed time. Dates before the system's epoch may not work on all operating systems. The time\nformats recognized are the same as for parsedate().\n\nThe function also takes an optional second argument that specifies the default time zone to\nuse when converting the date. This parameter is ignored if the zone is found in the date\nstring itself. If this parameter is missing, and the date string format does not contain any\nzone specification, then the local time zone is assumed.\n\nIf the zone is not \"\"GMT\"\" or numerical (like \"-0800\" or \"+0100\"), then the \"Time::Zone\"\nmodule must be installed in order to get the date recognized.\n"
                    },
                    {
                        "name": "parse_date",
                        "content": "This function will try to parse a date string, and then return it as a list of numerical\nvalues followed by a (possible undefined) time zone specifier; ($year, $month, $day, $hour,\n$min, $sec, $tz). The $year will be the full 4-digit year, and $month numbers start with 1\n(for January).\n\nIn scalar context the numbers are interpolated in a string of the \"YYYY-MM-DD hh:mm:ss\nTZ\"-format and returned.\n\nIf the date is unrecognized, then the empty list is returned (\"undef\" in scalar context).\n\nThe function is able to parse the following formats:\n\n\"Wed, 09 Feb 1994 22:23:32 GMT\"       -- HTTP format\n\"Thu Feb  3 17:03:55 GMT 1994\"        -- ctime(3) format\n\"Thu Feb  3 00:00:00 1994\",           -- ANSI C asctime() format\n\"Tuesday, 08-Feb-94 14:15:29 GMT\"     -- old rfc850 HTTP format\n\"Tuesday, 08-Feb-1994 14:15:29 GMT\"   -- broken rfc850 HTTP format\n\n\"03/Feb/1994:17:03:55 -0700\"   -- common logfile format\n\"09 Feb 1994 22:23:32 GMT\"     -- HTTP format (no weekday)\n\"08-Feb-94 14:15:29 GMT\"       -- rfc850 format (no weekday)\n\"08-Feb-1994 14:15:29 GMT\"     -- broken rfc850 format (no weekday)\n\n\"1994-02-03 14:15:29 -0100\"    -- ISO 8601 format\n\"1994-02-03 14:15:29\"          -- zone is optional\n\"1994-02-03\"                   -- only date\n\"1994-02-03T14:15:29\"          -- Use T as separator\n\"19940203T141529Z\"             -- ISO 8601 compact format\n\"19940203\"                     -- only date\n\n\"08-Feb-94\"         -- old rfc850 HTTP format    (no weekday, no time)\n\"08-Feb-1994\"       -- broken rfc850 HTTP format (no weekday, no time)\n\"09 Feb 1994\"       -- proposed new HTTP format  (no weekday, no time)\n\"03/Feb/1994\"       -- common logfile format     (no time, no offset)\n\n\"Feb  3  1994\"      -- Unix 'ls -l' format\n\"Feb  3 17:03\"      -- Unix 'ls -l' format\n\n\"11-15-96  03:52PM\" -- Windows 'dir' format\n\nThe parser ignores leading and trailing whitespace. It also allow the seconds to be missing\nand the month to be numerical in most formats.\n\nIf the year is missing, then we assume that the date is the first matching date *before*\ncurrent month. If the year is given with only 2 digits, then parsedate() will select the\ncentury that makes the year closest to the current date.\n"
                    },
                    {
                        "name": "time2iso",
                        "content": "Same as time2str(), but returns a \"YYYY-MM-DD hh:mm:ss\"-formatted string representing time\nin the local time zone.\n"
                    },
                    {
                        "name": "time2isoz",
                        "content": "Same as time2str(), but returns a \"YYYY-MM-DD hh:mm:ssZ\"-formatted string representing\nUniversal Time.\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "\"time\" in perlfunc, Time::Zone\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Gisle Aas <gisle@activestate.com>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is copyright (c) 1995-2019 by Gisle Aas.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
                "subsections": []
            }
        }
    }
}