date_create_immutable

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

date_create_immutable新しい DateTimeImmutable オブジェクトを作成する

説明

date_create_immutable(string $datetime = "now", ?DateTimeZone $timezone = null): DateTimeImmutable|false

これは DateTimeImmutable::__construct() の手続き型バージョンです。

DateTimeImmutable のコンストラクタと異なり、 datetime が不正な文字列だった場合には 例外をスローする代わりに false を返します。

パラメータ

DateTimeImmutable::__construct を参照ください。

戻り値

新しい DateTimeImmutable のインスタンスを返します。失敗した場合に false を返します

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant