{"id":13616385,"url":"https://github.com/symfony/clock","last_synced_at":"2026-04-02T20:18:48.477Z","repository":{"id":50299692,"uuid":"518735097","full_name":"symfony/clock","owner":"symfony","description":"Decouples applications from the system clock","archived":false,"fork":false,"pushed_at":"2026-03-31T21:31:43.000Z","size":79,"stargazers_count":431,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"8.1","last_synced_at":"2026-04-01T00:41:03.590Z","etag":null,"topics":["clock","component","php","psr20","symfony","symfony-component","time"],"latest_commit_sha":null,"homepage":"https://symfony.com/clock","language":"PHP","has_issues":false,"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/symfony.png","metadata":{"funding":{"github":["fabpot","nicolas-grekas"],"custom":"https://symfony.com/sponsor","tidelift":"packagist/symfony/symfony"},"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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-28T06:54:55.000Z","updated_at":"2026-03-30T15:22:44.000Z","dependencies_parsed_at":"2023-02-13T22:55:16.821Z","dependency_job_id":"f955d052-53f6-4b4d-a4b5-5bb7bda774ca","html_url":"https://github.com/symfony/clock","commit_stats":{"total_commits":41,"total_committers":14,"mean_commits":"2.9285714285714284","dds":0.6097560975609756,"last_synced_commit":"97bebc53548684c17ed696bc8af016880f0f098d"},"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"purl":"pkg:github/symfony/clock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fclock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fclock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fclock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fclock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/symfony","download_url":"https://codeload.github.com/symfony/clock/tar.gz/refs/heads/8.1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fclock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31315443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["clock","component","php","psr20","symfony","symfony-component","time"],"created_at":"2024-08-01T20:01:27.813Z","updated_at":"2026-04-02T20:18:48.457Z","avatar_url":"https://github.com/symfony.png","language":"PHP","readme":"Clock Component\n===============\n\nSymfony Clock decouples applications from the system clock.\n\nGetting Started\n---------------\n\n```bash\ncomposer require symfony/clock\n```\n\n```php\nuse Symfony\\Component\\Clock\\NativeClock;\nuse Symfony\\Component\\Clock\\ClockInterface;\n\nclass MyClockSensitiveClass\n{\n    public function __construct(\n        private ClockInterface $clock,\n    ) {\n        // Only if you need to force a timezone:\n        //$this-\u003eclock = $clock-\u003ewithTimeZone('UTC');\n    }\n\n    public function doSomething()\n    {\n        $now = $this-\u003eclock-\u003enow();\n        // [...] do something with $now, which is a \\DateTimeImmutable object\n\n        $this-\u003eclock-\u003esleep(2.5); // Pause execution for 2.5 seconds\n    }\n}\n\n$clock = new NativeClock();\n$service = new MyClockSensitiveClass($clock);\n$service-\u003edoSomething();\n```\n\nResources\n---------\n\n * [Documentation](https://symfony.com/doc/current/components/clock.html)\n * [Contributing](https://symfony.com/doc/current/contributing/index.html)\n * [Report issues](https://github.com/symfony/symfony/issues) and\n   [send Pull Requests](https://github.com/symfony/symfony/pulls)\n   in the [main Symfony repository](https://github.com/symfony/symfony)\n","funding_links":["https://github.com/sponsors/fabpot","https://github.com/sponsors/nicolas-grekas","https://symfony.com/sponsor","https://tidelift.com/funding/github/packagist/symfony/symfony"],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymfony%2Fclock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsymfony%2Fclock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymfony%2Fclock/lists"}