{"id":50769853,"url":"https://github.com/chansen/p5-time-str","last_synced_at":"2026-06-11T17:02:04.751Z","repository":{"id":354202469,"uuid":"1221371359","full_name":"chansen/p5-time-str","owner":"chansen","description":"Time::Str - Parse and format date/time strings in multiple standard formats","archived":false,"fork":false,"pushed_at":"2026-06-02T11:10:00.000Z","size":433,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T13:11:07.881Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chansen.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-26T05:33:59.000Z","updated_at":"2026-06-02T11:10:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chansen/p5-time-str","commit_stats":null,"previous_names":["chansen/p5-time-str"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/chansen/p5-time-str","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chansen%2Fp5-time-str","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chansen%2Fp5-time-str/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chansen%2Fp5-time-str/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chansen%2Fp5-time-str/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chansen","download_url":"https://codeload.github.com/chansen/p5-time-str/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chansen%2Fp5-time-str/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34208761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-11T17:02:03.970Z","updated_at":"2026-06-11T17:02:04.733Z","avatar_url":"https://github.com/chansen.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Time::Str\n\nParse and format date/time strings in multiple standard formats.\n\n```perl\nuse Time::Str qw(str2time str2date time2str);\n\n# Parse to Unix timestamp\nmy $time = str2time('2024-12-24T15:30:45Z');\n# 1735052445\n\nmy $time = str2time('Mon, 24 Dec 2012 15:30:45 +0100', format =\u003e 'RFC2822');\n\n# Parse to components\nmy %date = str2date('2024-12-24T15:30:45.500+01:00');\n# (year =\u003e 2024, month =\u003e 12, day =\u003e 24, hour =\u003e 15,\n#  minute =\u003e 30, second =\u003e 45, nanosecond =\u003e 500000000,\n#  tz_offset =\u003e 60)\n\n# Format Unix timestamp\nmy $str = time2str(1735052445);\n# '2024-12-24T15:30:45Z'\n\nmy $str = time2str(1735052445, format =\u003e 'RFC2822', offset =\u003e 60);\n# 'Tue, 24 Dec 2024 16:30:45 +0100'\n```\n\n## Supported Formats\n\n### Profiles of ISO 8601\n\n| Format                                                          | Example                      |\n|-----------------------------------------------------------------|------------------------------|\n| [ISO8601](https://metacpan.org/pod/Time::Str#ISO8601)           | `20241224T153045.500+0100`   |\n| [RFC4287](https://metacpan.org/pod/Time::Str#RFC4287)           | `2024-12-24T15:30:45Z`       |\n| [W3CDTF](https://metacpan.org/pod/Time::Str#W3CDTF)             | `2024-12-24T15:30:45+01:00`  |\n| [RFC5545](https://metacpan.org/pod/Time::Str#RFC5545)           | `20241224T153045Z`           |\n\n### Based on ISO 8601\n\n| Format                                                          | Example                                   |\n|-----------------------------------------------------------------|-------------------------------------------|\n| [RFC3339](https://metacpan.org/pod/Time::Str#RFC3339)           | `2024-12-24 15:30:45+01:00`               |\n| [RFC9557](https://metacpan.org/pod/Time::Str#RFC9557)           | `2024-12-24 15:30:45+01:00[Europe/Paris]` |\n| [ISO9075](https://metacpan.org/pod/Time::Str#ISO9075)           | `2024-12-24 15:30:45 +01:00`              |\n| [ASN1GT](https://metacpan.org/pod/Time::Str#ASN1GT)             | `20241224153045Z`                         |\n| [ASN1UT](https://metacpan.org/pod/Time::Str#ASN1UT)             | `241224153045Z`                           |\n| [RFC5280](https://metacpan.org/pod/Time::Str#RFC5280)           | `241224153045Z`                           |\n\n### RFC / IMF / HTTP / IMAP\n\n| Format                                                          | Example                              |\n|-----------------------------------------------------------------|--------------------------------------|\n| [RFC2822](https://metacpan.org/pod/Time::Str#RFC2822)           | `Tue, 24 Dec 2024 15:30:45 +0100`    |\n| [RFC2616](https://metacpan.org/pod/Time::Str#RFC2616)           | `Tue, 24 Dec 2024 15:30:45 GMT`      |\n| [RFC3501](https://metacpan.org/pod/Time::Str#RFC3501)           | `24-Dec-2024 15:30:45 +0100`         |\n\n### Unix / C Library\n\n| Format                                                          | Example                              |\n|-----------------------------------------------------------------|--------------------------------------|\n| [ANSIC](https://metacpan.org/pod/Time::Str#ANSIC)               | `Tue Dec 24 15:30:45 2024`           |\n| [UnixDate](https://metacpan.org/pod/Time::Str#UnixDate)         | `Tue Dec 24 15:30:45 UTC 2024`       |\n| [UnixStamp](https://metacpan.org/pod/Time::Str#UnixStamp)       | `Tue Dec 24 15:30:45.500 2024 UTC`   |\n| [GitDate](https://metacpan.org/pod/Time::Str#GitDate)           | `Tue Dec 24 15:30:45 2024 +0100`     |\n| [RubyDate](https://metacpan.org/pod/Time::Str#RubyDate)         | `Tue Dec 24 15:30:45 +0100 2024`     |\n\n`UnixStamp` is a superset of `ANSIC`, `GitDate`, `RubyDate`, and `UnixDate`.\n\n### Other\n\n| Format                                                           | Example                              |\n|------------------------------------------------------------------|--------------------------------------|\n| [ECMAScript](https://metacpan.org/pod/Time::Str#ECMAScript)      | `Tue Dec 24 2024 15:30:45 GMT+0100`  |\n| [CLF](https://metacpan.org/pod/Time::Str#CLF)                    | `24/Dec/2024:15:30:45 +0100`         |\n| [DateTime](https://metacpan.org/pod/Time::Str#DateTime)          | *(permissive, multi-format parser)*  |\n\n`DateTime` can parse `ISO8601` (extended format), `RFC3339`, `RFC9557`,\n`RFC4287`, `W3CDTF`, `ISO9075`, `RFC2822`, `RFC2616`, `RFC3501`, and\n`ECMAScript` formats.\n\nEach format is implemented according to its specification. Optional fields\nare optional. Constrained fields are validated. Day names, when present,\nare verified against the actual date.\n\n## The `DateTime` Format\n\nThe `DateTime` format is a permissive parser for real-world dates that does\nnot use heuristics. If it cannot parse the input unambiguously, it croaks.\n\n```perl\nstr2date('Monday, 24th December 2024 at 3:30 PM UTC+01:00',\n         format =\u003e 'DateTime');\n\nstr2date('2024-12-24T15:30:45+01:00[Europe/Stockholm]',\n         format =\u003e 'DateTime');\n\nstr2date('24.XII.2024', format =\u003e 'DateTime');\n```\n\nNumeric dates must be in year-month-day order. Ordinal suffixes must match\nthe day number. Four-digit years are required.\n\nSee [DATETIME FORMAT PARSING](https://metacpan.org/pod/Time::Str#DATETIME-FORMAT-PARSING) in the documentation.\n\n## Installation\n\n```\ncpanm Time::Str\n```\n\nRequires Perl 5.10.1 or later. Runtime dependencies are `Carp` and\n`Exporter`, both core modules.\n\n## Optional C/XS\n\nThe XS backend (C99) is loaded when a compiler is available; otherwise it\nfalls back to Pure Perl. The `TIME_STR_PP` environment variable forces the\nPure Perl path.\n\n```perl\nsay Time::Str::IMPLEMENTATION;  # \"XS\" or \"PP\"\n```\n\nThe XS backend includes native C parsers (generated by Ragel) for ASN.1 \nGeneralizedTime, ECMAScript, ISO 8601, ISO 9075, RFC 2822, RFC 3339, \nRFC 4287, RFC 9557 and W3CDTF formats. When available, these are \ntried first; otherwise parsing falls back to the precompiled regexps from\n`Time::Str::Regexp`. Both paths produce identical results.\n\n## Related Modules\n\n- [Time::Str::Regexp](https://metacpan.org/pod/Time::Str::Regexp) - Precompiled regexps with named captures for all formats\n- [Time::Str::Token](https://metacpan.org/pod/Time::Str::Token) - Token parsers (month names, day names, timezone offsets)\n- [Time::Str::Calendar](https://metacpan.org/pod/Time::Str::Calendar) - Gregorian calendar utilities (leap year, day-of-week, RDN conversion)\n- [Time::Str::Time](https://metacpan.org/pod/Time::Str::Time) - Time validation and epoch conversion\n- [Time::Str::Util](https://metacpan.org/pod/Time::Str::Util) - Binary search and time zone database utilities\n- [Time::LeapSecond](https://metacpan.org/pod/Time::LeapSecond) - Leap second table with TAI/UTC conversions\n- [Time::TZif](https://metacpan.org/pod/Time::TZif) - TZif timezone file parser with configurable local time resolution\n- [Time::TZif::POSIX](https://metacpan.org/pod/Time::TZif::POSIX) - POSIX TZ string parser with configurable local time resolution\n\n## Documentation\n\nFull documentation is available on [MetaCPAN](https://metacpan.org/pod/Time::Str) or via `perldoc Time::Str` after installation.\n\n## Standards\n\n- [ISO 8601:2019](https://www.iso.org/obp/ui/#iso:std:iso:8601)\n- [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)\n- [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) / [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322#section-3.3)\n- [RFC 2616](https://datatracker.ietf.org/doc/html/rfc2616#section-3.3) / [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1)\n- [RFC 3501](https://datatracker.ietf.org/doc/html/rfc3501#section-2.3.3) / [RFC 9051](https://datatracker.ietf.org/doc/html/rfc9051#section-2.3.3)\n- [RFC 4287](https://datatracker.ietf.org/doc/html/rfc4287#section-3.3)\n- [RFC 5280](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.5)\n- [RFC 5545](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.4)\n- [RFC 9557](https://datatracker.ietf.org/doc/html/rfc9557)\n- [ISO 9075](https://www.iso.org/standard/76583.html)\n- [ITU-T X.680 / ISO/IEC 8824-1](https://www.itu.int/rec/T-REC-X.680-202102-I) (ASN.1)\n- [W3C Date and Time Formats](https://www.w3.org/TR/NOTE-datetime)\n- [ECMAScript Date.prototype.toString](https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date.prototype.tostring)\n\n## Author\n\nChristian Hansen\n\n## License\n\nThis library is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchansen%2Fp5-time-str","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchansen%2Fp5-time-str","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchansen%2Fp5-time-str/lists"}