{"id":28619025,"url":"https://github.com/php-fig/clock","last_synced_at":"2025-06-12T04:20:02.229Z","repository":{"id":41049664,"uuid":"386079505","full_name":"php-fig/clock","owner":"php-fig","description":"PSR-20 repository","archived":false,"fork":false,"pushed_at":"2023-09-21T14:30:19.000Z","size":24,"stargazers_count":561,"open_issues_count":0,"forks_count":6,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-05T02:39:18.092Z","etag":null,"topics":["clock","php","psr-20"],"latest_commit_sha":null,"homepage":"https://www.php-fig.org/psr/psr-20/","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/php-fig.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-07-14T21:21:59.000Z","updated_at":"2025-06-04T20:07:42.000Z","dependencies_parsed_at":"2024-01-25T12:15:49.387Z","dependency_job_id":null,"html_url":"https://github.com/php-fig/clock","commit_stats":{"total_commits":17,"total_committers":9,"mean_commits":"1.8888888888888888","dds":0.5882352941176471,"last_synced_commit":"fb246b49699693265d21cb078d9173db28658665"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/php-fig/clock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-fig%2Fclock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-fig%2Fclock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-fig%2Fclock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-fig%2Fclock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-fig","download_url":"https://codeload.github.com/php-fig/clock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-fig%2Fclock/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259395542,"owners_count":22850851,"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":["clock","php","psr-20"],"created_at":"2025-06-12T04:19:49.808Z","updated_at":"2025-06-12T04:20:02.218Z","avatar_url":"https://github.com/php-fig.png","language":"PHP","readme":"# PSR Clock\n\nThis repository holds the interface for [PSR-20][psr-url].\n\nNote that this is not a clock of its own. It is merely an interface that\ndescribes a clock. See the specification for more details.\n\n## Installation\n\n```bash\ncomposer require psr/clock\n```\n\n## Usage\n\nIf you need a clock, you can use the interface like this:\n\n```php\n\u003c?php\n\nuse Psr\\Clock\\ClockInterface;\n\nclass Foo\n{\n    private ClockInterface $clock;\n\n    public function __construct(ClockInterface $clock)\n    {\n        $this-\u003eclock = $clock;\n    }\n\n    public function doSomething()\n    {\n        /** @var DateTimeImmutable $currentDateAndTime */\n        $currentDateAndTime = $this-\u003eclock-\u003enow();\n        // do something useful with that information\n    }\n}\n```\n\nYou can then pick one of the [implementations][implementation-url] of the interface to get a clock.\n\nIf you want to implement the interface, you can require this package and\nimplement `Psr\\Clock\\ClockInterface` in your code. \n\nDon't forget to add `psr/clock-implementation` to your `composer.json`s `provide`-section like this:\n\n```json\n{\n  \"provide\": {\n    \"psr/clock-implementation\": \"1.0\"\n  }\n}\n```\n\nAnd please read the [specification text][specification-url] for details on the interface.\n\n[psr-url]: https://www.php-fig.org/psr/psr-20\n[package-url]: https://packagist.org/packages/psr/clock\n[implementation-url]: https://packagist.org/providers/psr/clock-implementation\n[specification-url]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-20-clock.md\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-fig%2Fclock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-fig%2Fclock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-fig%2Fclock/lists"}