{"id":29012429,"url":"https://github.com/stephenhebert/datetime-iso8601","last_synced_at":"2025-10-29T16:20:54.429Z","repository":{"id":298437460,"uuid":"999965407","full_name":"stephenhebert/datetime-iso8601","owner":"stephenhebert","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-11T04:26:38.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-11T05:29:04.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephenhebert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-06-11T04:22:47.000Z","updated_at":"2025-06-11T04:26:41.000Z","dependencies_parsed_at":"2025-06-11T05:40:07.438Z","dependency_job_id":null,"html_url":"https://github.com/stephenhebert/datetime-iso8601","commit_stats":null,"previous_names":["stephenhebert/datetime-iso8601"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stephenhebert/datetime-iso8601","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Fdatetime-iso8601","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Fdatetime-iso8601/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Fdatetime-iso8601/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Fdatetime-iso8601/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephenhebert","download_url":"https://codeload.github.com/stephenhebert/datetime-iso8601/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Fdatetime-iso8601/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261931647,"owners_count":23232127,"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":[],"created_at":"2025-06-25T18:36:20.492Z","updated_at":"2025-10-29T16:20:54.377Z","avatar_url":"https://github.com/stephenhebert.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datetime-iso8601\n\nA lightweight TypeScript library for parsing, manipulating, and formatting ISO8601 date-time strings with time zone support.\n\n## Features\n\n- Parse ISO8601 date-time strings\n- Manipulate date and time components\n- Convert between time zones (IANA and UTC offset)\n- Format date-time as ISO8601 strings\n- Extract individual date/time components (e.g., weekday)\n\n## Installation\n\n```sh\nnpm install @stephenhebert/datetime-iso8601\n```\n\n## Usage\n\n```typescript\nimport { DateTimeIso8601 } from '@stephenhebert/datetime-iso8601'\n\nconst dt = new DateTimeIso8601('2024-06-01T12:34:56+00:00')\n\n// Get all components\nconsole.log(dt.get())\n\n// Get a specific component\nconsole.log(dt.get('year')) // 2024\n\n// Convert to a different time zone\ndt.tz('-05:00')\nconsole.log(dt.toString()) // e.g. \"2024-06-01T07:34:56-05:00\"\n\n// Update components\ndt.update({ hour: 15, minute: 0 })\nconsole.log(dt.toString()) // \"2024-06-01T15:00:56-05:00\"\n```\n\n## API\n\n### `class DateTimeIso8601`\n\n#### `constructor(isoString: string)`\n\nCreates a new instance from an ISO8601 string.\n\n#### `get(key?: string)`\n\nReturns all parsed components or a specific component.\n\n- `year`, `month`, `day`, `hour`, `minute`, `second`, `tzOffsetHour`, `tzOffsetMinute`, `date`, `time`, `tzOffset`, `weekday`, `weekdayIndex`\n\n#### `tz(tzOffset: string): this`\n\nConverts the date-time to the specified time zone offset (e.g., `'+00:00'`, `'-05:00'`).\n\n#### `update(newComponents: Partial\u003cDateTimeComponents\u003e, relative = false): this`\n\nUpdates date-time components. If `relative` is `true`, adds values to current components.\n\n#### `toString(): string`\n\nReturns the ISO8601 string representation.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhebert%2Fdatetime-iso8601","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenhebert%2Fdatetime-iso8601","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhebert%2Fdatetime-iso8601/lists"}