Results of 1 - 10 of about 89 for DateTimeImmutable (0.001 sec.)
- DateTimeImmutable クラス | PHP 8.3 10722
- DateTimeImmutable クラス (PHP 5 >= 5.5.0, PHP 7, PHP 8) はじめに 日付と時刻を表現します。 このクラスは DateTime と同じ振る舞いをします。 但し、 DateTime::modify() のような、 状態を変更して新しいオブジェクトを返すメソッドが呼び出された時を除
... きます。 クラス概要 class DateTimeImmutable implements DateTimeInterface { /* 継承した定数 */ public const string DateTimeInterface::ATOM = "Y-m-d\\TH:i:sP" ; public ... / public function __construct ( string $datetime = "now" , ? DateTimeZone $timezone = null ) #[ \NoDiscard ( message : "as DateTimeImmutable::add() does not modify the object itself" )] public function add ( DateInterval $interval ): DateTimeImmutable public stat ... ic function createFromFormat ( string $format , string $datetime , ? DateTimeZone $timezone = null ): DateTimeImmutable | false public static function createFromInterface ( DateTimeInterface $object ): DateTimeImmutable public static function ...
-
https://man.mtool.work/php/8.3/class.datetimeimmutable.html
- DateTimeImmutable::modify — タイムスタンプを変更した新しいオブジェクトを作る | ... 9800
- DateTimeImmutable::modify (PHP 5 >= 5.5.0, PHP 7, PHP 8) DateTimeImmutable::modify — タイムスタンプを変更した新しいオブジェクトを作る 説明 #[ \NoDiscard ( message : "as DateTimeImmutable::modify() does not modify the object itself" )] publi
... c function DateTimeImmutable::modify ( string $modifier ): DateTimeImmutable タイムスタンプを変更した新しい DateTimeImmutable オブジェクトを作ります。 ... されません。 パラメータ modifier 日付/時刻 文字列。有効な書式については 日付と時刻の書式 で説明しています。 戻り値 成功時に DateTimeImmutable を返します。 手続き型 の場合は、失敗したときに false を返します。 エラー / 例外 無効な日付/時刻の文字列が渡された場合、 Da ... ローされます。 PHP 8.3.0 より前のバージョンでは、警告が発生していました。 変更履歴 バージョン 説明 8.4.0 仮の戻り値の型が、 DateTimeImmutable になりました。 これより前のバージョンでは、 DateTimeImmutable | false でした。 8.3.0 無効な文字列が渡された場合、 DateTime ...
-
https://man.mtool.work/php/8.3/datetimeimmutable.modify.html
- DateTimeImmutable::add — 年月日時分秒の値を加え、新しいオブジェクトを返す | PHP... 9666
- DateTimeImmutable::add (PHP 5 >= 5.5.0, PHP 7, PHP 8) DateTimeImmutable::add — 年月日時分秒の値を加え、新しいオブジェクトを返す 説明 #[ \NoDiscard ( message : "as DateTimeImmutable::add() does not modify the object itself" )] public functio
... n DateTimeImmutable::add ( DateInterval $interval ): DateTimeImmutable 新しい DateTimeImmutable オブジェクトを作成し、 指定された DateInterval ... をこれに加え、 新しい値を返します。 パラメータ interval DateInterval オブジェクト。 戻り値 変更されたデータを持つ、新しい DateTimeImmutable オブジェクトを返します。 例 例1 DateTimeImmutable::add() の例 オブジェクト指向型 <?php $date = new DateTimeImmutable ( '20 ... 00-01-01' ); $newDate = $date -> add (new DateInterval ( 'P10D' )); echo $newDate -> format ( 'Y-m-d' ) . "\n" ; ?> 例2 DateTimeImmutable::add() のその他の例 <?php $date = new DateTimeImmutable ( '2000-01-01' ); $newDate = $date -> add (new DateInterval ( 'PT1 ...
-
https://man.mtool.work/php/8.3/datetimeimmutable.add.html
- DateTimeImmutable::createFromInterface — 指定された DateTimeInterface オブジェ... 9599
- DateTimeImmutable::createFromInterface (PHP 8) DateTimeImmutable::createFromInterface — 指定された DateTimeInterface オブジェクトをカプセル化した、新しい DateTimeImmutable オブジェクトを返す 説明 public static function DateTimeImmutable::cr
... eateFromInterface ( DateTimeInterface $object ): DateTimeImmutable パラメータ object 変更できないバージョンに変換する DateTimeInterface オブジェクト。 このオブジェクトは変更されませんが、 同 ... じ日付、時刻、タイムゾーンの情報が入った新しい DateTimeImmutable オブジェクトが作成されます。 戻り値 新しい DateTimeImmutable クラスのインスタンスを返します。 例 例1 DateTimeImmutable オブ ... ジェクトを作る <?php $date = new DateTime ( "2014-06-20 11:45 Europe/London" ); $immutable = DateTimeImmutable :: createFromInterface ( $date ); $date = new DateTimeImmutable ( "2014-06-20 11:45 Europe/London" ); $also_immutable = Da ...
-
https://man.mtool.work/php/8.3/datetimeimmutable.createfrominterface.html
- DateTimeImmutable::sub — 年月日時分秒の値を引く | PHP 8.3 9599
- DateTimeImmutable::sub (PHP 5 >= 5.5.0, PHP 7, PHP 8) DateTimeImmutable::sub — 年月日時分秒の値を引く 説明 #[ \NoDiscard ( message : "as DateTimeImmutable::sub() does not modify the object itself" )] public function DateTimeImmutable::sub (
... DateInterval $interval ): DateTimeImmutable 指定した DateInterval オブジェクトを、 指定した DateTimeImmutable オブジェクトから引き、 新しい DateTimeImmutable オブジェ ... クトを返します。 パラメータ interval DateInterval オブジェクト。 戻り値 変更されたデータを持つ、新しい DateTimeImmutable オブジェクトを返します。 エラー / 例外 サポートされていない操作を試みた場合、 DateInvalidOperationException がスローされま ... いない操作を試みた場合に、警告を発生させるのではなく、 DateInvalidOperationException がスローされるようになりました。 例 例1 DateTimeImmutable::sub() の例 オブジェクト指向型 <?php $date = new DateTimeImmutable ( '2000-01-20' ); $newDate = $date -> sub (new DateInte ...
-
https://man.mtool.work/php/8.3/datetimeimmutable.sub.html
- DateTimeImmutable::setDate — 日付を設定する | PHP 8.3 9492
- DateTimeImmutable::setDate (PHP 5 >= 5.5.0, PHP 7, PHP 8) DateTimeImmutable::setDate — 日付を設定する 説明 #[ \NoDiscard ( message : "as DateTimeImmutable::setDate() does not modify the object itself" )] public function DateTimeImmutable::s
... etDate ( int $year , int $month , int $day ): DateTimeImmutable DateTimeImmutable オブジェクトの現在の日付を、指定された日付にします。 指定した日付を設定した、新しい DateTimeImmutable オ ... オブジェクトを変更します。 year その日付の年。 month その日付の月。 day その日付の日。 戻り値 変更されたデータを持つ、新しい DateTimeImmutable オブジェクトを返します。 例 例1 DateTimeImmutable::setDate() の例 オブジェクト指向型 <?php $date = new DateTimeImmutable ( ... > format ( 'Y-m-d' ); 上の例の出力は以下となります。 2001-02-03 例2 範囲を超えた値が親の値に加算される例 <?php $date = new DateTimeImmutable (); $newDate = $date -> setDate ( 2001 , 2 , 28 ); echo $newDate -> format ( 'Y-m-d' ) . "\n" ; $newDate = $date -> setDat ...
-
https://man.mtool.work/php/8.3/datetimeimmutable.setdate.html
- DateTimeImmutable::setTimestamp — Unix タイムスタンプを用いて日付と時刻を設定す... 9492
- DateTimeImmutable::setTimestamp (PHP 5 >= 5.5.0, PHP 7, PHP 8) DateTimeImmutable::setTimestamp — Unix タイムスタンプを用いて日付と時刻を設定する 説明 #[ \NoDiscard ( message : "as DateTimeImmutable::setTimestamp() does not modify the object
... itself" )] public function DateTimeImmutable::setTimestamp ( int $timestamp ): DateTimeImmutable Unix タイムスタンプを用いて日付と時刻を設定し、 古いものから新しい Dat ... eTimeImmutable オブジェクトを作成して返します。 パラメータ timestamp 日付を表す Unix タイムスタンプ。 DateTimeImmutable::modify() を @ フォーマットと共に使うと、 int の範囲外のタイムスタンプを設定できます。 戻り値 変更されたデータを持つ、新し ... い DateTimeImmutable オブジェクトを返します。 例 例1 DateTimeImmutable::setTimestamp() の例 オブジェクト指向型 <?php $date = new DateTimeImmuta ...
-
https://man.mtool.work/php/8.3/datetimeimmutable.settimestamp.html
- 日付・時刻 | PHP 8.3 9425
- 日付・時刻 はじめに DateTimeImmutable と、 それに関連するクラスを使うと、日付/時刻 に関する情報を表現できます。 このオブジェクトは、日付/時刻 の文字列表現か、 現在のシステム時刻から作成できます。 この情報を変更したり、 フォーマット化するため
... ジェクトを返す DateTime::createFromFormat — 指定した書式で時刻文字列をパースする DateTime::createFromImmutable — 与えられた DateTimeImmutable オブジェクトをカプセル化した、新しい DateTime のインスタンスを返す DateTime::createFromInterface — 指定された DateTimeInte ... オブジェクトを返す DateTime::createFromTimestamp — Unix タイムスタンプからインスタンスを生成する DateTime::getLastErrors — DateTimeImmutable::getLastErrors のエイリアス DateTime::modify — タイムスタンプを変更する DateTime::__set_state — __set_state ハンドラ DateT ... tTimezone — DateTime オブジェクトのタイムゾーンを設定する DateTime::sub — 年月日時分秒の値を DateTime オブジェクトから引く DateTimeImmutable — DateTimeImmutable クラス DateTimeImmutable::add — 年月日時分秒の値を加え、新しいオブジェクトを返す DateTimeImmutable::__ ...
-
https://man.mtool.work/php/8.3/book.datetime.html
- DateTimeImmutable::__construct — 新しい DateTimeImmutable オブジェクトを返す | ... 9265
- DateTimeImmutable::__construct date_create_immutable (PHP 5 >= 5.5.0, PHP 7, PHP 8) DateTimeImmutable::__construct -- date_create_immutable — 新しい DateTimeImmutable オブジェクトを返す 説明 オブジェクト指向型 public function DateTimeImmutable
... $timezone = null ) 手続き型 function date_create_immutable ( string $datetime = "now" , ? DateTimeZone $timezone = null ): DateTimeImmutable | false 新しい DateTimeImmutable オブジェクトを返します。 パラメータ datetime 日付/時刻 文字列。有効な書式については 日付と ... 28T15:00:00+02:00 や 2010-07-05T06:00:00Z など) は、 timezone パラメータや現在のタイムゾーンは無視されます。 戻り値 新しい DateTimeImmutable のインスタンスを返します。 エラー / 例外 無効な日付/時刻の文字列が渡された場合、 DateMalformedStringException がスローされ ... eption がスローされるようになりました。 7.1.0 マイクロ秒が '00000' ではなく、実際の値で埋められるようになりました。 例 例1 DateTimeImmutable::__construct() の例 オブジェクト指向型 <?php try { $date = new DateTimeImmutable ( '2000-01-01' ); } catch ( Exception $e ...
-
https://man.mtool.work/php/8.3/datetimeimmutable.construct.html
- DateTimeImmutable::setISODate — ISO 日付を設定する | PHP 8.3 9024
- DateTimeImmutable::setISODate (PHP 5 >= 5.5.0, PHP 7, PHP 8) DateTimeImmutable::setISODate — ISO 日付を設定する 説明 #[ \NoDiscard ( message : "as DateTimeImmutable::setISODate() does not modify the object itself" )] public function DateTimeImmutable
... eImmutable::setISODate ( int $year , int $week , int $dayOfWeek = 1 ): DateTimeImmutable ISO 8601 標準形式、 つまり特定の日付ではなく、週と日のオフセットで日付を設定した、 新しい DateTimeImmutable オブジェクトを ... ータ year その日付の年。 week その日付の週。 dayOfWeek 週の最初の日からのオフセット。 戻り値 変更されたデータを持つ、新しい DateTimeImmutable オブジェクトを返します。 例 例1 DateTimeImmutable::setISODate() の例 オブジェクト指向型 <?php $date = new DateTimeImmutabl ... ) . "\n" ; 上の例の出力は以下となります。 2008-01-07 2008-01-13 例2 範囲を超えた値が親の値に加算される例 <?php $date = new DateTimeImmutable (); $newDate = $date -> setISODate ( 2008 , 2 , 7 ); echo $newDate -> format ( 'Y-m-d' ) . "\n" ; $newDate = $date -> setI ...
-
https://man.mtool.work/php/8.3/datetimeimmutable.setisodate.html