{"id":16439541,"url":"https://github.com/sevenoutman/date-z","last_synced_at":"2026-04-18T03:32:56.829Z","repository":{"id":200772899,"uuid":"694992032","full_name":"SevenOutman/date-z","owner":"SevenOutman","description":"Date-time API with timezone in mind.","archived":false,"fork":false,"pushed_at":"2023-10-22T12:21:38.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T06:32:30.162Z","etag":null,"topics":["date","datetime","javascript","timezone"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/SevenOutman.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}},"created_at":"2023-09-22T05:59:24.000Z","updated_at":"2023-10-17T14:03:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"7beb8d8d-e744-42b4-91cd-905e0866298a","html_url":"https://github.com/SevenOutman/date-z","commit_stats":null,"previous_names":["sevenoutman/date-z"],"tags_count":1,"template":false,"template_full_name":"SevenOutman/ts-lib-starter","purl":"pkg:github/SevenOutman/date-z","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SevenOutman%2Fdate-z","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SevenOutman%2Fdate-z/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SevenOutman%2Fdate-z/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SevenOutman%2Fdate-z/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SevenOutman","download_url":"https://codeload.github.com/SevenOutman/date-z/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SevenOutman%2Fdate-z/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31955736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["date","datetime","javascript","timezone"],"created_at":"2024-10-11T09:09:40.899Z","updated_at":"2026-04-18T03:32:56.812Z","avatar_url":"https://github.com/SevenOutman.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# date-z\n\n[![npm version](https://img.shields.io/npm/v/%40sevenoutman/date-z)](https://npm.im/@sevenoutman/date-z)\n[![codecov](https://codecov.io/gh/SevenOutman/date-z/graph/badge.svg?token=5xJVmpIodz)](https://codecov.io/gh/SevenOutman/date-z)\n\nDate-time API with timezone in mind.\n\n## Install\n\n```bash\nnpm i @sevenoutman/date-z\n```\n\n## Usage\n\n\u003e 🚧 This library is still in early development. API could change. Use with caution.\n\n```js\nimport { ZonedDateTime } from \"@sevenoutman/date-z\"\n\nconst zonedDate = new ZonedDateTime(\n  1409529600000, // \"2014-09-01T00:00:00.000Z\"\n  \"Europe/Dublin\", // UTC+1\n)\n\nzonedDate.getHours() // 1\nzonedDate.toString() // \"2014-09-01T01:00:00.000+01:00[Europe/Dublin]\"\n```\n\n## API\n\n### CalendarDate\n\nA calendar date is a date representation without time and timezone information.\nIt does **not** have an equivalent timestamp, because the same date could be represented by different timestamps in different timezones.\n\n```js\nimport { CalendarDate } from \"@sevenoutman/date-z\"\n\nconst date = new CalendarDate(2014, 8, 1) // 2014-09-01\n```\n\nCalendar dates themselves can be compared with `CalendarDate.difference()` function.\n\n```js\nimport { CalendarDate } from \"@sevenoutman/date-z\"\n\nconst date1 = new CalendarDate(2014, 8, 1) // 2014-09-01\nconst date2 = new CalendarDate(2014, 8, 2) // 2014-09-02\n\nCalendarDate.difference(date1, date2) // -1\n```\n\n### Instant\n\nA instant is a timestamp representation without timezone information.\nIt does **not** have an equivalent calendar date, because the same timestamp could be represented by different dates in different timezones.\n\n```js\nimport { Instant } from \"@sevenoutman/date-z\"\n\nconst time = new Instant(1409526720000) // \"2014-09-01T00:00:00.000Z\"\n```\n\nTo convert between a calendar date (or date-time) and timestamp requires specifying the context.\n\n```js\nimport { Instant, CalendarDate } from \"@sevenoutman/date-z\"\n\nconst time = new Instant(1409526720000) // \"2014-09-01T00:00:00.000+08:00\"\n\ntime.toCalendarDate(\"Europe/Dublin\") // { year: 2014, month: 7, date: 31 }\ntime.toCalendarDate(\"Asia/Shanghai\") // { year: 2014, month: 8, date: 1 }\n```\n\n## Philosophy\n\nThe philosophy behind this library is similar to what's behind [Temporal proposal](https://github.com/tc39/proposal-temporal) -\nA date-time representation does not have an equivalent timestamp, unless timezone is specified in the context, and vice versa.\n\n## License\n\nMIT \u0026copy; [Doma](https://github.com/SevenOutman)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevenoutman%2Fdate-z","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsevenoutman%2Fdate-z","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevenoutman%2Fdate-z/lists"}