Skip to content

Add getDateTime and findDateTime - #13

Merged
odan merged 2 commits into
masterfrom
datetime
Oct 25, 2026
Merged

odan merged 2 commits into
masterfrom
datetime

Conversation

@odan

@odan odan commented Oct 25, 2026

Copy link
Copy Markdown
Member

Add ArrayReader::getDateTime() and ArrayReader::findDateTime(). Both return a DateTimeImmutable and do not require Chronos.

Accepted values:

  • A date string
  • An existing DateTimeImmutable, including Chronos
  • A mutable DateTime
  • An integer or finite float Unix timestamp, parsed with DateTimeImmutable::createFromTimestamp()
  • getDateTime() throws InvalidArgumentException when the value is missing or not a date. findDateTime() returns null instead.

Note:

createFromTimestamp() requires PHP 8.4, so support for PHP 8.2 and 8.3 is dropped.

Follow-up to #11.

@odan
odan merged commit d4fc104 into master Oct 25, 2026
4 checks passed
@odan
odan deleted the datetime branch October 25, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant