DateTimeImmutable::modify

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

DateTimeImmutable::modifyタイムスタンプを変更した新しいオブジェクトを作る

説明

public DateTimeImmutable::modify(string $modifier): DateTimeImmutable|false

タイムスタンプを変更した新しい DateTimeImmutable オブジェクトを作ります。 元のオブジェクトは変更されません。

パラメータ

object

手続き型のみ: date_create() が返す DateTime オブジェクト。 この関数は、このオブジェクトを変更します。

modifier

日付/時刻 文字列。有効な書式については 日付と時刻の書式 で説明しています。

戻り値

新しく作ったオブジェクトを返します。 失敗した場合に false を返します。