{"id":28402804,"url":"https://github.com/korora-tech/temps","last_synced_at":"2025-06-26T17:31:52.495Z","repository":{"id":63537449,"uuid":"568545260","full_name":"korora-tech/temps","owner":"korora-tech","description":"Parse human-readable time expressions in Rust. Supports relative times, dates, weekdays, and combined expressions in multiple languages. Works with chrono and jiff.","archived":false,"fork":false,"pushed_at":"2025-06-17T18:16:55.000Z","size":109,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-25T04:41:15.930Z","etag":null,"topics":["chrono","date","date-parser","datetime","i18n","internationalization","jiff","multilingual","natural-language-support","parser","rust","time","time-parser"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/korora-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2022-11-20T21:17:24.000Z","updated_at":"2025-06-17T18:15:51.000Z","dependencies_parsed_at":"2025-03-05T10:37:48.098Z","dependency_job_id":"29c3d3a6-00e2-4a16-9330-c62af73461e5","html_url":"https://github.com/korora-tech/temps","commit_stats":null,"previous_names":["icepuma-dev/temps","korora-tech/temps"],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/korora-tech/temps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/korora-tech%2Ftemps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/korora-tech%2Ftemps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/korora-tech%2Ftemps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/korora-tech%2Ftemps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/korora-tech","download_url":"https://codeload.github.com/korora-tech/temps/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/korora-tech%2Ftemps/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262113305,"owners_count":23261001,"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":["chrono","date","date-parser","datetime","i18n","internationalization","jiff","multilingual","natural-language-support","parser","rust","time","time-parser"],"created_at":"2025-06-01T16:11:21.792Z","updated_at":"2025-06-26T17:31:52.475Z","avatar_url":"https://github.com/korora-tech.png","language":"Rust","readme":"# temps\n\n[![](https://img.shields.io/crates/v/temps.svg)](https://crates.io/crates/temps)\n[![](https://github.com/korora-tech/temps/actions/workflows/ci.yml/badge.svg)](https://github.com/korora-tech/temps/actions/workflows/ci.yml)\n[![](https://img.shields.io/crates/d/temps.svg)](https://crates.io/crates/temps)\n\n`temps` or `[tã]` is a library for working with time and dates in Rust. Parse human-readable time expressions.\n\n```rust\nuse temps::chrono::{parse_to_datetime, Language};\n\n// English\nlet dt = parse_to_datetime(\"in 3 hours\", Language::English)?;\nlet dt = parse_to_datetime(\"5 minutes ago\", Language::English)?;\nlet dt = parse_to_datetime(\"tomorrow\", Language::English)?;\nlet dt = parse_to_datetime(\"next monday\", Language::English)?;\nlet dt = parse_to_datetime(\"2024-12-25T15:30:00Z\", Language::English)?;\n\n// German  \nlet dt = parse_to_datetime(\"in 3 Stunden\", Language::German)?;\nlet dt = parse_to_datetime(\"vor 5 Minuten\", Language::German)?;\nlet dt = parse_to_datetime(\"morgen\", Language::German)?;\nlet dt = parse_to_datetime(\"nächsten Montag\", Language::German)?;\n```\n\n## Features\n\n- 🌍 Multiple languages (English, German)\n- 📅 Relative times (`in 2 hours`, `3 days ago`)\n- 📆 Day references (`today`, `yesterday`, `tomorrow`)\n- 📅 Weekdays (`monday`, `next friday`, `last wed`)\n- 🕐 Time parsing (`3:30 pm`, `14:45`, `9:00 am`)\n- 📅 Combined expressions (`tomorrow at 3:30 pm`, `next monday at 9:00`)\n- 📆 Date formats (`15/03/2024`, `31-12-2025`, `15.03.2024`)\n- 🕐 ISO 8601 dates (`2024-12-25T15:30:00Z`)\n- 🔧 Works with `chrono` and `jiff`\n\n## Installation\n\n```toml\n[dependencies]\n# With chrono\ntemps = { version = \"1.0.0\", features = [\"chrono\"] }\n\n# With jiff\ntemps = { version = \"1.0.0\", features = [\"jiff\"] }\n```\n\n## Usage\n\n### Basic\n\n```rust\nuse temps::chrono::{parse_to_datetime, Language};\n\n// Relative times\nlet meeting = parse_to_datetime(\"in 2 hours\", Language::English)?;\nlet deadline = parse_to_datetime(\"in 3 days\", Language::English)?;\nlet reminder = parse_to_datetime(\"in 30 Minuten\", Language::German)?;\n\n// Day references\nlet today = parse_to_datetime(\"today\", Language::English)?;\nlet tomorrow = parse_to_datetime(\"morgen\", Language::German)?;\n\n// Weekdays\nlet next_meeting = parse_to_datetime(\"next tuesday\", Language::English)?;\nlet last_friday = parse_to_datetime(\"last friday\", Language::English)?;\n\n// Times\nlet afternoon = parse_to_datetime(\"3:30 pm\", Language::English)?;\nlet morning = parse_to_datetime(\"09:00\", Language::German)?;\n\n// Combined day and time\nlet appointment = parse_to_datetime(\"tomorrow at 2:00 pm\", Language::English)?;\nlet termin = parse_to_datetime(\"Montag um 15:30\", Language::German)?;\n\n// Date formats\nlet birthday = parse_to_datetime(\"15/03/2024\", Language::English)?;\nlet holiday = parse_to_datetime(\"24.12.2024\", Language::German)?;\n\n// Absolute times\nlet christmas = parse_to_datetime(\"2024-12-25T00:00:00Z\", Language::English)?;\n```\n\n### Supported Formats\n\n**Relative times**:\n- English: `in 5 minutes`, `2 hours ago`\n- German: `in 5 Minuten`, `vor 2 Stunden`\n\n**Day references**:\n- English: `today`, `yesterday`, `tomorrow`\n- German: `heute`, `gestern`, `morgen`\n\n**Weekdays**:\n- English: `monday`/`mon`, `tuesday`/`tue`, etc.\n- Modifiers: `next monday`, `last friday`\n- German: `Montag`/`mo`, `Dienstag`/`di`, etc.\n- Modifiers: `nächsten Montag`, `letzten Freitag`\n\n**Time formats**:\n- English: `3:30 pm`, `10:15 am`, `14:30`\n- German: `14:30`, `9:45 Uhr`\n\n**Combined day and time**:\n- English: `tomorrow at 3:30 pm`, `next monday at 9:00 am`\n- German: `morgen um 14:30`, `nächsten Montag um 21:00 Uhr`\n\n**Date formats**:\n- English: `15/03/2024`, `31-12-2025` (DD/MM/YYYY or DD-MM-YYYY)\n- German: `15.03.2024` (DD.MM.YYYY)\n\n**Special keywords**:\n- English: `now`\n- German: `jetzt`\n\n**ISO 8601**: `2024-01-15T10:30:00Z`\n\nTime units: seconds, minutes, hours, days, weeks, months, years\n\n### Advanced\n\n```rust\n// Direct parser access\nuse temps_core::{parse, Language, TimeExpression};\n\nlet (_, expr) = parse(\"in 3 hours\", Language::English)?;\nmatch expr {\n    TimeExpression::Relative(rel) =\u003e println!(\"{} {} {:?}\", rel.amount, rel.unit, rel.direction),\n    TimeExpression::Absolute(abs) =\u003e println!(\"ISO: {}\", abs.time),\n    TimeExpression::Now =\u003e println!(\"Right now!\"),\n    TimeExpression::Day(day) =\u003e println!(\"Day reference: {:?}\", day),\n    TimeExpression::Time(time) =\u003e println!(\"Time: {:02}:{:02}\", time.hour, time.minute),\n    TimeExpression::DayTime(dt) =\u003e println!(\"Day + time: {:?} at {:02}:{:02}\", dt.day, dt.time.hour, dt.time.minute),\n    TimeExpression::Date(date) =\u003e println!(\"Date: {:02}/{:02}/{:04}\", date.day, date.month, date.year),\n}\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkorora-tech%2Ftemps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkorora-tech%2Ftemps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkorora-tech%2Ftemps/lists"}