{"id":25562091,"url":"https://github.com/imclerran/roc-isodate","last_synced_at":"2026-02-01T18:33:48.431Z","repository":{"id":218733549,"uuid":"747209484","full_name":"imclerran/roc-isodate","owner":"imclerran","description":"A Roc package for parsing ISO Date/Time strings. 📆⏰📦","archived":false,"fork":false,"pushed_at":"2025-09-17T14:25:29.000Z","size":365,"stargazers_count":11,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-17T16:44:05.457Z","etag":null,"topics":["functional-programming","iso8601","package","roc-lang"],"latest_commit_sha":null,"homepage":"https://www.imclerran.com/roc-isodate/","language":"Roc","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imclerran.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-01-23T13:41:58.000Z","updated_at":"2025-09-17T14:24:35.000Z","dependencies_parsed_at":"2024-01-30T20:10:28.525Z","dependency_job_id":"3279ba2c-069e-43ff-bc69-e0a3969edb58","html_url":"https://github.com/imclerran/roc-isodate","commit_stats":null,"previous_names":["imclerran/roc-isodatetime","imclerran/iso-roc-date"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/imclerran/roc-isodate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imclerran%2Froc-isodate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imclerran%2Froc-isodate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imclerran%2Froc-isodate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imclerran%2Froc-isodate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imclerran","download_url":"https://codeload.github.com/imclerran/roc-isodate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imclerran%2Froc-isodate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28985818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T18:17:03.387Z","status":"ssl_error","status_checked_at":"2026-02-01T18:16:57.287Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["functional-programming","iso8601","package","roc-lang"],"created_at":"2025-02-20T19:00:36.825Z","updated_at":"2026-02-01T18:33:48.426Z","avatar_url":"https://github.com/imclerran.png","language":"Roc","funding_links":[],"categories":["Roc Packages 📦"],"sub_categories":[],"readme":"# Roc IsoDate\n\n[![Roc-Lang][roc_badge]][roc_link]\n[![GitHub last commit][last_commit_badge]][last_commit_link]\n[![CI status][ci_status_badge]][ci_status_link]\n[![Latest release][version_badge]][version_link]\n\nRoc-IsoDate is a universal date and time package for Roc. It Features several useful types for working with dates and times. Its primary types (`Date`/`Time`/`DateTime`) store dates and times in a human friendly manner, but allow easy conversion to and from computer friendly types like `Utc` as well as web web friendly ISO 8601 strings. Roc IsoDate is intended to be a one-stop-shop for all things date and time. 📆 ⏰ 📦\n\n## Implementation\n\nRoc IsoDate's API revolves around its types, primarily `Date`, `Time`, and `DateTime`. These types provide useful functions for such as `from_iso_str`, `to_iso_str`, as well as functions for parsing directly from a list of Utf8 bytes. The types are based on records containing some of the most common data fields a user might want for working with dates and times in a human friendly manner, IE: `year`, `month`, `day_of_month`, `day_of_year`, `hour`, `minute`, `second` and `nanosecond`. It also provides functions for performing math operations on these dates, as well as various constructors, and functions to convert to and from nanoseconds since the epoch for dates or since midnght for time.\n\nNote that due to the expense of purchasing the ISO 8601-2:2019 standard document, my implementation of ISO string parsing is based on a [2016 pre-release][iso_8601_doc] copy of the 8601-1 standard, so my implementation may not fully conform to the latest revision to the standard.\n\n## Progress\n\n- Full support for parsing all date representations.\n- Full support for parseing local time representations.\n- Full support for offset from UTC time representations.\n- Full support for combined date/time representations.\n- Can Parse from `Str` or from a `List U8` of Utf-8 bytes.\n- Unify API around `Date`/`Time`/`DateTime` types\n  - This means converting to and from ISO strings is as simple as:\n  - `DateTime.from_iso_str(str)` or `Time.to_iso_str(date)`\n  - Similarly, converting to and from `Utc` is easy:\n  - `Date.to_nanos_since_epoch(date) |\u003e Utc.from_nanos_since_epoch` or\n    `Utc.to_nanos_since_epoch(utc) |\u003e DateTime.from_nanos_since_epoch`\n\n## Future Plans\n\n- Time interval representations will be added once the parsing to Date/Time/DateTime is complete [DONE 🚀].\n- Once Parsing is complete, add formatting dates and times to ISO strings.\n- Research adding custom encoding/decoding for json parsers.\n\n## Unified API\n\nTo extend functionality and simplify the API, library _now_ simply provides a collection of types for working with dates. Each of these types provide all the necessary functions for interacting with it, including functions for converting to and from ISO strings, and converting to and from Utc types, as well as various other constructors and math functions.\n\nThus, an application might look like the following:\n\n```roc\nmain! = |_|\n    req = format_request(\"America/Chicago\")\n    response = Http.send!(req)?\n    if response.status \u003e= 200 and response.status \u003c= 299 then\n        iso_str = get_iso_str(response.body)?\n        dt_now = DT.from_iso_str(iso_str)?\n\n        date_str = dt_now |\u003e DT.format(\"{YYYY}-{MM}-{DD}\")\n        time_str = dt_now |\u003e DT.format(\"{hh}:{mm}:{ss}\")\n        \"The current Zulu date is: ${date_str}\" |\u003e Stdout.line!?\n        \"The current Zulu time is: ${time_str}\"|\u003e Stdout.line!\n    else\n        Err FailedToGetServerResponse(response.status)\n```\n\nThis is just a small sample of the available functionality, but meant to demonstrate the general design of the API. Moving to and from computer-friendly representations like `Utc`, web-friendly representations like ISO `Str`s, and human friendly representations like `DateTime` are all just a single function call away. `Durations` and `TimeInterval`s also add quality of life functionality for easily manipulating dates and times.\n\n## Known Issues\n\n- Missing features mentioned above.\n- ISO Requirement for combined date-time strings to have only non-reduced accuracy dates is not enforced\n- ISO Requirement for combined date-time strings to be in completely basic or completely extended format are not enforced.\n\n## ISO 8601 Date/Time Format\n\nDescription of ISO date/time [format][iso_8601_md] (WIP)\n\n[roc_badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fpastebin.com%2Fraw%2FcFzuCCd7\n[roc_link]: https://github.com/roc-lang/roc\n[ci_status_badge]: https://img.shields.io/github/actions/workflow/status/imclerran/roc-isodate/ci.yaml?logo=github\u0026logoColor=lightgrey\n[ci_status_link]: https://github.com/imclerran/Roc-IsoDate/actions/workflows/ci.yaml\n[last_commit_badge]: https://img.shields.io/github/last-commit/imclerran/roc-isodate?logo=git\u0026logoColor=lightgrey\n[last_commit_link]: https://github.com/imclerran/Roc-IsoDate/commits/main/\n[version_badge]: https://img.shields.io/github/v/release/imclerran/roc-isodate\n[version_link]: https://github.com/imclerran/roc-isodate/releases/latest\n[iso_8601_doc]: https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf\n[utc_link]: https://github.com/roc-lang/basic-cli/blob/main/platform/Utc.roc\n[utctime_link]: https://github.com/imlerran/roc-isodate/blob/main/platform/UtcTime.roc\n[iso_8601_md]: ISO_8601.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimclerran%2Froc-isodate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimclerran%2Froc-isodate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimclerran%2Froc-isodate/lists"}