{"id":18407540,"url":"https://github.com/simplecomplex/php-time","last_synced_at":"2025-04-12T21:14:17.834Z","repository":{"id":49566211,"uuid":"273509957","full_name":"simplecomplex/php-time","owner":"simplecomplex","description":"DateTime extension providing more, simpler and safer methods","archived":false,"fork":false,"pushed_at":"2021-07-01T16:03:42.000Z","size":235,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T04:42:43.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/simplecomplex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-19T14:13:01.000Z","updated_at":"2021-06-14T11:01:45.000Z","dependencies_parsed_at":"2022-08-24T03:41:01.735Z","dependency_job_id":null,"html_url":"https://github.com/simplecomplex/php-time","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplecomplex%2Fphp-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplecomplex%2Fphp-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplecomplex%2Fphp-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplecomplex%2Fphp-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplecomplex","download_url":"https://codeload.github.com/simplecomplex/php-time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631682,"owners_count":21136562,"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":"2024-11-06T03:14:25.861Z","updated_at":"2025-04-12T21:14:17.800Z","avatar_url":"https://github.com/simplecomplex.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# (PHP) Time\n\u003csmall\u003ecomposer namespace: simplecomplex/**time**\u003c/small\u003e\n\n- [Requirements](#Requirements)\n- [License](#MIT-licensed)\n\n### [Time](src/Time.php)\nextends native \\DateTime to fix shortcomings and defects, and provide more properties, getters and setters.\n\n## Features\n- enhanced timezone awareness\n- diff which works correctly with non-UTC timezones\n- safer formatting and modifying\n- is stringable (sic!), to ISO-8601\n- JSON serializes to string ISO-8601 with timezone marker\n- freezable\n- directly accessible time part properties\n- more, simpler and safer getters and setters\n\n## Related classes\n\n### [TimeInterval](src/TimeInterval.php)\nhas the same properties as native `\\DateInterval` plus **signed relatives and totals**, and works with non-UTC timezones.\n\n#### Time::diffTime()\nreturns interval with actual differences.\n\n#### Time::diffDstIgnorant()\nreturns an interval which ignores daylight saving time shift.\u003cbr\u003e\nIn everyday business you often don't want the difference between a date _outside_ daylight saving time (DST)\u003cbr\u003e\nand a date _inside_ DST to be off by the DST offset.\u003cbr\u003e\nThat offset can be particularly nasty if either of the dates is _at_ or _close to_ midnight,\u003cbr\u003e\nbecause then the _days_ difference may get 1 off.\n\n### [TimeSpan](src/TimeSpan.php)\nIt's main feature is to check **overlap** vs. another TimeSpan.\n\n### [TimeImmutable](src/TimeImmutable.php)\nIs an immutable extending Time, not `\\DateTimeImmutable`.\n\n### [TimeLocal](src/TimeLocal.php)\nForces instances to be in local (default) timezone.\n\n\n## Requirements\n\n- PHP \u003e=7.2 (64-bit)\n\n### Development requirements\n- [PHPUnit](https://github.com/sebastianbergmann/phpunit) ^8 || ^9\n- [Jasny PHPUnit extension](https://github.com/jasny/phpunit-extension) ^0.2\n\n### Suggestions\n- [SimpleComplex Inspect](https://github.com/simplecomplex/inspect)\n\n## MIT licensed\n\n[License and copyright](https://github.com/simplecomplex/php-time/blob/master/LICENSE).\n[Explained](https://tldrlegal.com/license/mit-license).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplecomplex%2Fphp-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplecomplex%2Fphp-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplecomplex%2Fphp-time/lists"}