Implement PSR-20 in datetime.time service

Created on 22 January 2025, 2 months ago

Problem/Motivation

PSR-20 defines a standard interface for system clocks.
The datetime.time service is a system clock that fits this description.

If it implemented PSR-20, the service could be used with other libraries that can use a PSR-20 clock. And so it would encourage service reuse instead of having multiple implementations on the same website.

Steps to reproduce

\Drupal::time() instanceof Psr\Clock\ClockInterface;

Proposed resolution

Core would need to depend on psr/clock and then we would need to add a now() method to the Time class.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

11.1 πŸ”₯

Component

datetime.module

Created by

πŸ‡«πŸ‡·France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024