{"id":41643666,"url":"https://github.com/ppmpreetham/date-rs","last_synced_at":"2026-01-24T15:15:15.967Z","repository":{"id":330811001,"uuid":"1123325883","full_name":"ppmpreetham/date-rs","owner":"ppmpreetham","description":"Fastest Modern JavaScript date utility library to date.","archived":false,"fork":false,"pushed_at":"2025-12-29T07:28:00.000Z","size":110,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-30T14:28:13.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ppmpreetham.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":"2025-12-26T16:31:12.000Z","updated_at":"2025-12-29T10:03:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ppmpreetham/date-rs","commit_stats":null,"previous_names":["ppmpreetham/date-rs"],"tags_count":null,"template":false,"template_full_name":"napi-rs/package-template-pnpm","purl":"pkg:github/ppmpreetham/date-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fdate-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fdate-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fdate-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fdate-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppmpreetham","download_url":"https://codeload.github.com/ppmpreetham/date-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2Fdate-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28730317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"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":[],"created_at":"2026-01-24T15:15:15.885Z","updated_at":"2026-01-24T15:15:15.958Z","avatar_url":"https://github.com/ppmpreetham.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# date-rs\n[![npm version](https://img.shields.io/npm/v/date-rs.svg?style=flat-square)](https://www.npmjs.com/package/date-rs)\n[![npm downloads](https://img.shields.io/npm/dm/date-rs.svg?style=flat-square)](https://www.npmjs.com/package/date-rs)\n[![GitHub stars](https://img.shields.io/github/stars/ppmpreetham/date-rs?style=flat-square)](https://github.com/ppmpreetham/date-rs/stargazers)\n[![License](https://img.shields.io/github/license/ppmpreetham/date-rs.svg?style=flat-square)](https://github.com/ppmpreetham/date-rs/blob/main/LICENSE)\n\nA date utility library made in Rust, inspired by date-fns.\n\n\u003e [!WARNING]\n\u003e Pure UTC timestamp operations, always exact 24h days, no local DST wall-clock shifts (matches @date-fns/utc, recommended for predictable behavior).\n\n\n**date-rs** is a high-performance native Node.js addon that brings the familiar API of **[date-fns](https://date-fns.org)** to your projects, but compiled in Rust using **napi-rs** and powered by the rock-solid **`time`** crate.\n\n- **Predictable UTC behavior**: exact 24-hour days, no DST wall-clock surprises (matches `@date-fns/utc` philosophy).\n- **Lightning fast**: native Rust performance for heavy date calculations.\n- **Drop-in friendly**: functions like `addDays`, `differenceInMonths`, `intervalToDuration`, and more.\n- **Zero dependencies**: tiny bundle size, tree-shakable via individual exports (planned).\n\nPerfect for servers, APIs, CLI tools, or any project tired of JavaScript date quirks.\n\u003e If you love **date-fns** but want speed + predictability, this is for you.\n\n## Installation\n\n```bash\nnpm install date-rs\n# or\nyarn add date-rs\n# or\npnpm add date-rs\n```\n\nPre-built binaries for macOS, Linux, and Windows (x64/arm64).\n\n## Quick Start\n\n```js\nconst {\n  addDays,\n  addMonths,\n  differenceInMonths,\n  intervalToDuration,\n  eachDayOfInterval,\n} = require('date-rs');\n\n// works with JS Date timestamps (ms)\nconst now = Date.now();\n\nconsole.log(addDays(now, 7));                    // +7 days (exact 24h * 7)\nconsole.log(addMonths(now, 1));                  // month addition with day clamping\nconsole.log(differenceInMonths(now, now - 30*24*60*60*1000)); // calendar-aware\n\nconsole.log(intervalToDuration(now - 365*24*60*60*1000, now));\n// → { years: 1 } (sparse object, zeros omitted)\n\nconsole.log(eachDayOfInterval(now - 5*24*60*60*1000, now));\n// → array of timestamps for each day (midnight UTC)\n```\n\nAll functions accept/return **milliseconds since Unix epoch** (`number`), just like `new Date().getTime()`.\n\n## Supported Functions\n\nCore set (growing fast!):\n\n- `addMilliseconds`, `addSeconds`, `addMinutes`, `addHours`, `addDays`, `addWeeks`, `addMonths`, `addQuarters`, `addYears`\n- `subMilliseconds`, `subSeconds`, ..., `subYears`\n- `differenceInMilliseconds`, `differenceInSeconds`, ..., `differenceInYears`\n- `intervalToDuration`, calendar-aware breakdown (sparse output)\n- `min`, `max`\n- `eachDayOfInterval`, `eachWeekOfInterval`, `eachMonthOfInterval`, `eachQuarterOfInterval`, `eachYearOfInterval`\n- `eachWeekendOfInterval`\n- `intervalToDailyIntervals` (custom utility)\n\nMore coming: `format`, `parseISO`, `startOfDay`, `isBefore`, etc.\n\n## Performance\n\nPerformance Comparison (date-rs vs date-fns)\n| #  | Operation                | date-rs (ops/sec) | date-fns (ops/sec) | Speedup |\n| -- | ------------------------ | -------------- | ------------------ | ------: |\n| 0  | addDays                  | 9,735,210      | 4,436,033          |   2.19x |\n| 1  | addMonths                | 1,290,617      | 2,405,921          |   0.54x |\n| 2  | addYears                 | 1,304,327      | 2,435,951          |   0.54x |\n| 3  | differenceInDays         | 10,046,153     | 476,835            |  21.07x |\n| 4  | differenceInMonths       | 534,292        | 536,591            |   1.00x |\n| 5  | differenceInYears        | 531,558        | 841,040            |   0.63x |\n| 6  | min                      | 2,843,677      | 1,171,226          |   2.43x |\n| 7  | max                      | 2,760,072      | 1,204,440          |   2.29x |\n| 8  | isWeekend                | 1,457,684      | 7,288,419          |   0.20x |\n| 9  | eachDayOfInterval        | 206,257        | 94,628             |   2.18x |\n| 10 | eachMonthOfInterval      | 346,165        | 271,307            |   1.28x |\n| 11 | compareAsc               | 10,045,283     | 3,557,989          |   2.82x |\n| 12 | isAfter                  | 10,702,804     | 3,648,799          |   2.93x |\n| 13 | isBefore                 | 9,944,303      | 3,563,595          |   2.79x |\n| 14 | addBusinessDays          | 1,378,186      | 2,398,528          |   0.57x |\n| 15 | differenceInBusinessDays | 532,662        | 261,855            |   2.03x |\n\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n- Add more date-fns functions\n- Benchmarks\n- Docs/examples\n\n## License\n\nMIT © Preetham Pemmasani\n\n---\n\n**Built with ❤️ in Rust for the Node.js ecosystem.**\n\nStar this repo if you like it, helps spread the word! ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppmpreetham%2Fdate-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppmpreetham%2Fdate-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppmpreetham%2Fdate-rs/lists"}