{"id":22281371,"url":"https://github.com/zeta12ti/parse_duration","last_synced_at":"2025-07-28T20:30:44.472Z","repository":{"id":56428931,"uuid":"100106462","full_name":"zeta12ti/parse_duration","owner":"zeta12ti","description":"Parses a duration from a string.","archived":false,"fork":false,"pushed_at":"2021-03-25T04:56:22.000Z","size":41,"stargazers_count":16,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-23T23:36:11.073Z","etag":null,"topics":["duration","parse","string"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeta12ti.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-12T10:54:30.000Z","updated_at":"2024-04-23T23:36:11.074Z","dependencies_parsed_at":"2022-08-15T18:31:17.055Z","dependency_job_id":null,"html_url":"https://github.com/zeta12ti/parse_duration","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/zeta12ti/parse_duration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeta12ti%2Fparse_duration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeta12ti%2Fparse_duration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeta12ti%2Fparse_duration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeta12ti%2Fparse_duration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeta12ti","download_url":"https://codeload.github.com/zeta12ti/parse_duration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeta12ti%2Fparse_duration/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267580457,"owners_count":24110844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"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":["duration","parse","string"],"created_at":"2024-12-03T16:17:37.402Z","updated_at":"2025-07-28T20:30:44.204Z","avatar_url":"https://github.com/zeta12ti.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parse_duration\n[![Crates.io](https://img.shields.io/crates/v/parse_duration.svg)](https://crates.io/crates/parse_duration)\n[![Travis](https://img.shields.io/travis/zeta12ti/parse_duration.svg)](https://travis-ci.org/zeta12ti/parse_duration)\n\n***IMPORTANT***: This repository is no longer being updated. Before deciding to use it, check if any of the [issues](https://github.com/zeta12ti/parse_duration/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) are deal breakers. In particular, this crate should not be used with untrusted input (see [this issue](https://github.com/zeta12ti/parse_duration/issues/21)).\n\nThis crate provides a function `parse` for parsing strings into durations.\nThe parser is based on the standard set by\n[systemd.time](https://www.freedesktop.org/software/systemd/man/systemd.time.html#Parsing%20Time%20Spans),\nbut extends it significantly.\nFor example, negative numbers, decimals and exponents are allowed.\n\n```\nextern crate parse_duration;\n\nuse parse_duration::parse;\nuse std::time::Duration;\n\n// One hour less than a day\nassert_eq!(parse(\"1 day -1 hour\"), Ok(Duration::new(82_800, 0)));\n// Using exponents\nassert_eq!(parse(\"1.26e-1 days\"), Ok(Duration::new(10_886, 400_000_000)));\n// Extra things will be ignored\nassert_eq!(\n    parse(\"Duration: 1 hour, 15 minutes and 29 seconds\"),\n    Ok(Duration::new(4529, 0))\n);\n```\n\n\n## Documentation\nDocumentation may be found [on docs.rs](https://docs.rs/parse_duration).\n\n\n## Minimum Rust version policy\nThis crate's minimum supported rustc version is 1.28.0.\n\nIf the minimum rustc version needs to be increased, there will be a new major version. For example, if parse\\_duration 2.0.0 requires rustc 1.28.0, then parse\\_duration 2.x.y will also only require rustc 1.28.0. Since this crate is fairly simple, there likely won't be any need to increase the minimum version in the foreseeable future.\n\n## License\nThis software is licensed under the MIT License.\n\n\n## Contributing\nFeel free to file an issue or submit a pull request if there's a bug you want fixed\nor a feature you want implemented.\n\nBy contributing to this project, you agree to license your code under the terms of\nthe MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeta12ti%2Fparse_duration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeta12ti%2Fparse_duration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeta12ti%2Fparse_duration/lists"}