From b71523d0d15d9ec5497a58c34eb71fceee512214 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 26 Jan 2026 08:40:07 +0000 Subject: [PATCH 1/2] Initial plan From 05db036a2b55ec22ebfbef017e70c7544614373f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 26 Jan 2026 08:43:59 +0000 Subject: [PATCH 2/2] Add DateTime identifier usage example to documentation Co-authored-by: soyuka <1321971+soyuka@users.noreply.github.com> --- core/identifiers.md | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/core/identifiers.md b/core/identifiers.md index 046940f684b..85fb8ad7978 100644 --- a/core/identifiers.md +++ b/core/identifiers.md @@ -172,6 +172,71 @@ services: Your `PersonProvider` will now work as expected! +## Using DateTime as an Identifier + +DateTime identifiers are useful for resources that are naturally identified by timestamps or dates, +such as daily reports, scheduled events, or time-series data. API Platform provides built-in support +for using `\DateTime`, `\DateTimeImmutable`, and `\DateTimeInterface` as resource identifiers. + +### Basic Example with Doctrine Entity + +Here's a complete example of an entity using `\DateTimeImmutable` as the identifier: + +```php +