Skip to content

Document the DateTimeImmutable support - #44

Merged
GautierDele merged 1 commit into
mainfrom
feature/datetime-immutable
Jul 31, 2026
Merged

Document the DateTimeImmutable support#44
GautierDele merged 1 commit into
mainfrom
feature/datetime-immutable

Conversation

@GautierDele

Copy link
Copy Markdown
Member

Documents dateTimeImmutable(), added in xefi/faker-php#82 and released since, which was missing from the DateTime extension page.

Also documents that fromTimestamp / toTimestamp accept any DateTimeInterface — that PR widened them from DateTime to DateTimeInterface, so a DateTimeImmutable can now be passed as a bound too — as well as a unix timestamp int or a strtotime string. That was never spelled out on the page, which only ever showed the string form.

Checked each documented call against main:

dateTime            -> DateTime | 2023-06-04 23:26:41
dateTimeImmutable   -> DateTimeImmutable | 1998-12-21 05:45:19
timestamp(DTI, int) -> 1615724336 | 2021-03-14 | in range: true
dateTimeImmutable(DateTime, string) -> DateTimeImmutable | 2022-06-13

The other recently merged PRs need no doc change

Adds the dateTimeImmutable() method introduced in xefi/faker-php#82, and
documents that the fromTimestamp / toTimestamp bounds accept any
DateTimeInterface, a unix timestamp or a strtotime string.
@GautierDele
GautierDele merged commit 245b4a2 into main Jul 31, 2026
@GautierDele
GautierDele deleted the feature/datetime-immutable branch July 31, 2026 11:37
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