PHP 8.3.4 Released!

DateTime::setISODate

date_isodate_set

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

DateTime::setISODate -- date_isodate_setISO 形式の日付を設定する

説明

オブジェクト指向型

public DateTime::setISODate(int $year, int $week, int $dayOfWeek = 1): DateTime

手続き型

date_isodate_set(
    DateTime $object,
    int $year,
    int $week,
    int $dayOfWeek = 1
): DateTime

ISO 8601 標準形式、つまり特定の日付ではなく、週と日のオフセットで日付を設定します。

DateTimeImmutable::setISODate() に似ていますが、 DateTime を使って動作します。

手続き型のバージョンは、 DateTime オブジェクトを最初の引数に取ります。

パラメータ

object

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

year

その日付の年。

week

その日付の週。

dayOfWeek

週の最初の日からのオフセット。

戻り値

メソッドチェインに使う、変更された DateTime オブジェクトを返します。

参考

add a note

User Contributed Notes

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