{"id":15636352,"url":"https://github.com/westy92/timelib-rust","last_synced_at":"2025-04-30T06:47:23.867Z","repository":{"id":162633066,"uuid":"637160166","full_name":"westy92/timelib-rust","owner":"westy92","description":"A small Rust wrapper around the timelib library.","archived":false,"fork":false,"pushed_at":"2024-09-16T04:50:33.000Z","size":194,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-02T01:42:22.368Z","etag":null,"topics":["bindgen","bindgen-wrapper","ffi","ffi-bindings","ffi-wrapper","mongodb","php","rust","rust-crate","rust-crates","rust-ffi","rust-ffi-bindings","rust-ffi-wrappers","rust-lang","rust-library","strtotime","timelib","timelib-library"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/timelib","language":"C","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/westy92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["westy92"]}},"created_at":"2023-05-06T17:35:33.000Z","updated_at":"2024-09-16T04:41:18.000Z","dependencies_parsed_at":"2024-05-05T20:23:33.508Z","dependency_job_id":"ece4343e-4a39-4c51-b50a-c36c41f13dad","html_url":"https://github.com/westy92/timelib-rust","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":0.3142857142857143,"last_synced_commit":"1e9a4d640f1231ef5dfbe20a9761481633a11c96"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westy92%2Ftimelib-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westy92%2Ftimelib-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westy92%2Ftimelib-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westy92%2Ftimelib-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/westy92","download_url":"https://codeload.github.com/westy92/timelib-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223776381,"owners_count":17200702,"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","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":["bindgen","bindgen-wrapper","ffi","ffi-bindings","ffi-wrapper","mongodb","php","rust","rust-crate","rust-crates","rust-ffi","rust-ffi-bindings","rust-ffi-wrappers","rust-lang","rust-library","strtotime","timelib","timelib-library"],"created_at":"2024-10-03T11:02:28.374Z","updated_at":"2024-11-09T02:29:51.969Z","avatar_url":"https://github.com/westy92.png","language":"C","funding_links":["https://github.com/sponsors/westy92"],"categories":[],"sub_categories":[],"readme":"# Timelib for Rust\n\n[![Crates.io](https://img.shields.io/crates/v/timelib)](https://crates.io/crates/timelib)\n[![Build Status](https://github.com/westy92/timelib-rust/actions/workflows/ci.yml/badge.svg)](https://github.com/westy92/timelib-rust/actions/workflows/ci.yml)\n[![docs.rs](https://img.shields.io/docsrs/timelib)](https://docs.rs/timelib)\n[![Code Coverage](https://codecov.io/gh/westy92/timelib-rust/branch/main/graph/badge.svg)](https://codecov.io/gh/westy92/timelib-rust)\n[![Funding Status](https://img.shields.io/github/sponsors/westy92)](https://github.com/sponsors/westy92)\n\nTimelib for Rust is a small Rust wrapper around the [timelib](https://github.com/derickr/timelib) library that is used to power PHP and MongoDB.\n\n## Installation\n\nYou can install with:\n\n```bash\ncargo add timelib\n```\n\n## Usage\n\n```rust\nlet tz = timelib::Timezone::parse(\"America/Chicago\").expect(\"Error parsing timezone!\");\ntimelib::strtotime(\"tomorrow\", None, \u0026tz);\ntimelib::strtotime(\"next tuesday\", Some(1654318823), \u0026tz);\n```\n\nView the tests for more examples.\n\n## Optional Features\n\nThe genereated `re2c` outputs are bundled and automatically used. If you wish to generate these files yourself, do the following:\n\n1. Install `re2c`. You can install it easily on all major platforms:\n    - Linux: `apt-get install re2c`\n    - Mac: `brew install re2c`\n    - Windows: `choco install re2c`\n    - From source: [re2c.org](https://re2c.org/)\n1. Enable the `re2c` feature:\n    - `timelib = { version = \"0.3\", features = [\"re2c\"] }`\n\n## Building\n\nMake sure to check out all submodules.\n\nInitial clone:\n\n```bash\ngit clone --recurse-submodules https://github.com/westy92/timelib-rust\n```\n\nPost-clone:\n\n```bash\ngit submodule init \u0026\u0026 git submodule update\n```\n\nYou should now be able to run `cargo build` and `cargo test`.\n\nIf using the `re2c` feature, make sure to install `re2c` as described above. i.e. `cargo test --features re2c`.\n\n## Updating the submodule version\n\n```bash\ngit submodule update --remote\n```\n\nMake sure to regenerate the re2c outputs and copy them to `pregenerated/`.\n\n```bash\ncd ext/timelib/\nmake parse_date.c parse_iso_intervals.c\ncp parse_date.c ../../pregenerated/\ncp parse_iso_intervals.c ../../pregenerated/\n```\n\n## Publishing\n\nRemove `--dry-run` to publish for real.\n\n```bash\ncargo publish --dry-run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesty92%2Ftimelib-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwesty92%2Ftimelib-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesty92%2Ftimelib-rust/lists"}