{"id":17978358,"url":"https://github.com/ad-si/timeify","last_synced_at":"2025-04-04T00:24:18.253Z","repository":{"id":57158999,"uuid":"48319963","full_name":"ad-si/timeify","owner":"ad-si","description":"ISO 8601 based time module with support for dates, times, durations and time intervals.","archived":false,"fork":false,"pushed_at":"2016-03-13T21:59:29.000Z","size":36,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T08:49:22.285Z","etag":null,"topics":["duration","interval","iso8601","moment","utc"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ad-si.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}},"created_at":"2015-12-20T12:44:44.000Z","updated_at":"2024-06-20T08:47:15.000Z","dependencies_parsed_at":"2022-09-08T09:02:21.038Z","dependency_job_id":null,"html_url":"https://github.com/ad-si/timeify","commit_stats":null,"previous_names":["adius/hour","adius/timeify"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Ftimeify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Ftimeify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Ftimeify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Ftimeify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ad-si","download_url":"https://codeload.github.com/ad-si/timeify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247099566,"owners_count":20883423,"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":["duration","interval","iso8601","moment","utc"],"created_at":"2024-10-29T17:33:21.530Z","updated_at":"2025-04-04T00:24:18.237Z","avatar_url":"https://github.com/ad-si.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Timeify\n\nISO 8601 based time and date module.\nParses an ISO string and returns an instance of the corresponding class.\n\nCheck out the respective packages for details:\n\n- [Moment](https://github.com/datatypesjs/moment)\n- [Duration](https://github.com/datatypesjs/duration)\n- [Interval and RecurringInterval](https://github.com/datatypesjs/interval)\n\n\n## Installation\n\n```shell\nnpm install --save timeify\n```\n\n\n## Usage\n\n```js\nconst timeify = require('timeify')\n\nconst moment = timeify('2015-11-24T21:32:43')\nconst duration = timeify('P2DT10H37M24.345S')\nconst interval = timeify('2015-11-24--2015-11-26')\nconst recurringInterval = timeify('R3/2015-11-24/P1D')\n```\n\nPossible formats for the time-string (when a string can be interpreted as a date or a time, date takes precedence)\n\n1. Date\n\t- Millennium: '2'\n\t- Century: `20`\n\t- Decade: `201`\n\t- Year: `2015`, `0002`\n\t- Month: `2015-11`\n\t- Week:\n\t\t- `2015-W48`\n\t\t- `2015W48`\n\t- Day:\n\t\t- `2015-11-24`\n\t\t- `20151124`\n\t\t- `2015-W48-2`\n\t\t- `2015W482`\n\t\t- `2015-328`\n\t\t- `2015328`\n\n2. Time of Day (currently not supported as standalone version)\n\t- Hour: `21`\n\t- Minute:\n\t\t- `21:32`\n\t\t- `2132`\n\t- Second:\n\t\t- `21:32:43`\n\t\t- `213243`\n\t- Millisecond:\n\t\t- `21:32:43.654`\n\t\t- `213243.654`\n\n3. Date Time\n\t- `\u003cdate\u003eT\u003ctime\u003e`\n\t- `\u003cdate\u003e \u003ctime\u003e`\n\n4. Duration\n\t- `P\u003cdatetime\u003e`\n\t- Year: `P1Y`\n\t- Month: `P1M`\n\t- Week: `P1W`\n\t- Day: `P1D`\n\t- Hour:\n\t\t- `P1H`\n\t\t- `PT1H`\n\t- Minute:\n\t\t- `PT1M`\n\t- Second:\n\t\t- `P1S`\n\t\t- `PT1S`\n\n5. Time Interval\n\t- `\u003cstart-datetime\u003e/\u003cend-datetime\u003e`\n\t- `\u003cstart-datetime\u003e--\u003cend-datetime\u003e`\n\n\t- `\u003cstart-datetime\u003e/\u003cduration\u003e`\n\t- `\u003cstart-datetime\u003e--\u003cduration\u003e`\n\n\t- `\u003cduration\u003e/\u003cend-datetime\u003e`\n\t- `\u003cduration\u003e--\u003cend-datetime\u003e`\n\n\t- `duration` + context information\n\n6. Recurring Interval\n\t- `R\u003cnumber-of-recurrences\u003e/\u003ctime-interval\u003e`\n\n\n## Conventions\n\nIn contrast to the ISO 8601 standard\nthis module assumes that times points are specified in UTC per default.\nThis means in order to work with local times\nthey must be explicitly entered with their offset (e.g. `17:45:34+0300`)\nor the relevant flags must be set.\nThis also means that the `Z` to denote UTC times is optional.\n\nIn order to fix the naming schema of native classes and unify it\nwith the usage in the ISO 8601 specification\nthe internal `Instant` class encapsulates the Javascript `Date` class.\nIt defines an infinitely accurate moment in time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-si%2Ftimeify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fad-si%2Ftimeify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-si%2Ftimeify/lists"}