« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 30 for days (0.001 sec.)
DateInterval::format — 間隔をフォーマットする | PHP 8.3 12200
DateInterval::format (PHP 5 >= 5.3.0, PHP 7, PHP 8) DateInterval::format — 間隔をフォーマットする 説明 public function DateInterval::format ( string $format ): string 間隔をフォーマットします。 パラメータ format 次の文字を、 format パラメー ... 加されました。 例 例1 DateInterval の例 <?php $interval = new DateInterval ( 'P2Y4DT6H8M' ); echo $interval -> format ( '%d days' ); 上の例の出力は以下となります。 4 days 例2 DateInterval での繰り越しの例 <?php $interval = new DateInterval ( 'P32D' ); ... echo $interval -> format ( '%d days' ); 上の例の出力は以下となります。 32 days 例3 DateInterval および DateTime::diff() での修飾子 %a および %d <?php $january ... 2010-02-01' ); $interval = $february -> diff ( $january ); // %a は総日数を出力します echo $interval -> format ( '%a total days' ). "\n" ; // 一方 %d は、月数に含まれない日数のみを出力します echo $interval -> format ( '%m month, %d days' ); 上の例の出 ...
https://man.mtool.work/php/8.3/dateinterval.format.html
定義済み定数 | PHP 8.3 11144
定義済み定数 以下の定数が定義されています。 この関数の拡張モジュールが PHP 組み込みでコンパイルされているか、 実行時に動的にロードされている場合のみ使用可能です。 CAL_EASTER_DEFAULT ( int ) easter_days() で、1753年より前はユリウス暦に従って ... 、 それ以降はグレゴリオ暦に従って復活祭の日付を計算する。 CAL_EASTER_ROMAN ( int ) easter_days() で、1583年より前はユリウス暦に従って、 それ以降はグレゴリオ暦に従って復活祭の日付を計算する。 CAL_EASTER_ALWAYS_GREGORIA ... N ( int ) easter_days() で、先発グレゴリオ暦に従って、 復活祭の日付を計算する。 CAL_EASTER_ALWAYS_JULIAN ( int ) easter_days() で、ユリウス暦に従 ... って、 復活祭の日付を計算する。 CAL_GREGORIAN ( int ) cal_days_in_month() 、 cal_from_jd() 、 cal_info() および cal_to_jd() で、先発グレゴリオ暦を使う。 CAL_JULIAN ( int ) cal_days_in_m ...
https://man.mtool.work/php/8.3/calendar.constants.html
cal_days_in_month — 指定した年とカレンダーについて、月の日数を返す | PHP 8.3 11144
cal_days_in_month (PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8) cal_days_in_month — 指定した年とカレンダーについて、月の日数を返す 説明 function cal_days_in_month ( int $calendar , int $month , int $year ): int この関数は、指定した calendar について ... カレンダーにおける月。 year 選択したカレンダーにおける年。 戻り値 指定したカレンダーの、その月の日数を返します。 例 例1 cal_days_in_month() の例 <?php $number = cal_days_in_month ( CAL_GREGORIAN , 8 , 2003 ); // 31 echo "2003 年 8 月の日数は { $number ...
https://man.mtool.work/php/8.3/function.cal-days-in-month.html
easter_days — 指定した年において、3 月 21 日から復活祭までの日数を得る | PHP 8.... 10771
easter_days (PHP 4, PHP 5, PHP 7, PHP 8) easter_days — 指定した年において、3 月 21 日から復活祭までの日数を得る 説明 function easter_days ( ? int $year = null , int $mode = CAL_EASTER_DEFAULT ): int 指定した年 year において、3 月 21 日から復 ... て、3 月 21 日から復活祭までの日数を返します。 変更履歴 バージョン 説明 8.0.0 year は、nullable になりました。 例 例1 easter_days() の例 <?php echo easter_days ( 1999 ); // 14, i.e. April 4 echo easter_days ( 1492 ); // 32, i.e. April 22 echo easter_da ...
https://man.mtool.work/php/8.3/function.easter-days.html
DateTimeInterface::diff — ふたつの DateTime オブジェクトの差を返す | PHP 8.3 10689
DateTimeInterface::diff DateTimeImmutable::diff DateTime::diff date_diff (PHP 5 >= 5.3.0, PHP 7, PHP 8) DateTimeInterface::diff -- DateTimeImmutable::diff -- DateTime::diff -- date_diff — ふたつの DateTime オブジェクトの差を返す 説明 オブジ ... target = new DateTimeImmutable ( '2009-10-13' ); $interval = $origin -> diff ( $target ); echo $interval -> format ( '%R%a days' ); 上の例の出力は以下となります。 +2 days 手続き型 <?php $origin = date_create ( '2009-10-11' ); $target = date_create ( ... '2009-10-13' ); $interval = date_diff ( $origin , $target ); echo $interval -> format ( '%R%a days' ); 上の例の出力は以下となります。 +2 days 例2 夏時間の切り替え期間中の DateTimeInterface::diff() の動き <?php $originalTi ... 1 08:30:00 Europe/London" ); $interval = $originalTime -> diff ( $targetTime ); echo $interval -> format ( "%H:%I:%S (Full days: %a)" ), "\n" ; 上の例の出力は以下となります。 24:30:00 (Full days: 0) 例3 DateTimeInterface::diff() が返す範囲 このメソッ ...
https://man.mtool.work/php/8.3/datetime.diff.html
IntlCalendar::setMinimalDaysInFirstWeek — 特定の年や月における、最初の週の日数... 10316
IntlCalendar::setMinimalDaysInFirstWeek (PHP 5 >= 5.5.1, PHP 7, PHP 8) IntlCalendar::setMinimalDaysInFirstWeek — 特定の年や月における、最初の週の日数の最小値を設定する 説明 オブジェクト指向型 public function IntlCalendar::setMinimalDaysInFi ... rstWeek ( int $days ): true 手続き型 function intlcal_set_minimal_days_in_first_week ( IntlCalendar $calendar , int $days ): true 特定の年や月 ... 初の週になります。 そうでない場合、前年の最後の週として扱われます。 パラメータ calendar IntlCalendar クラスのインスタンス。 days 設定する最小の日数。 戻り値 常に true を返します。 エラー / 例外 days が範囲外の値 ( 1 より小さいか、 7 より大きい) の場合 ...
https://man.mtool.work/php/8.3/intlcalendar.setminimaldaysinfirstweek.html
DateInterval クラス | PHP 8.3 8984
DateInterval クラス (PHP 5 >= 5.3.0, PHP 7, PHP 8) はじめに 日付の間隔をあらわします。 格納方式は、固定値 (年、月、日、時など) あるいは相対時刻 ( DateTimeImmutable と DateTime のコンストラクタがサポートしている書式) となります。 さらに厳密に ... ublic int $ d ; public int $ h ; public int $ i ; public int $ s ; public float $ f ; public int $ invert ; public mixed $ days ; public bool $ from_string ; public string $ date_string ; /* メソッド */ public function __construct ( string $duration ... 秒の100万分の1です。 invert 間隔が負の数になっている場合は 1 、そうでない場合は 0 。 DateInterval::format() を参照ください。 days DateTimeImmutable::diff() や DateTime::diff() で作られた DateInterval オブジェクトの場合は、開始日と終了日の間の(丸一日、つ ... まり0時から24時までの一日全体という意味での)日の数。 それ以外の場合は days は false となります。 from_string DateInterval::createFromDateString() で作られた DateInterval オブジェクトの場合は、 この ...
https://man.mtool.work/php/8.3/class.dateinterval.html
easter_date — 指定した年におけるローカルの復活祭の真夜中のUnix時を得る | PHP 8.... 8821
easter_date (PHP 4, PHP 5, PHP 7, PHP 8) easter_date — 指定した年におけるローカルの復活祭の真夜中のUnix時を得る 説明 function easter_date ( ? int $year = null , int $mode = CAL_EASTER_DEFAULT ): int 指定した年yearにおける復活祭の真夜中のUni ... しません。 その結果、PHP の他の日付関数と組み合わせて使ったときに予期せぬ結果になる可能性があります。 回避策として、 easter_days() を DateTime や DateInterval と組み合わせて使えば、PHP で設定したタイムゾーンにおける復活祭の開始時刻を算出できます。 <?p ... hp function get_easter_datetime ( $year ) { $base = new DateTime ( " $year -03-21" ); $days = easter_days ( $year ); return $base -> add (new DateInterval ( "P { $days } D" )); } foreach ( range ( 2012 , 2015 ) as ... aster in 2014 is on April 20 Easter in 2015 is on April 5 参考 1970年以前または2037年以降の復活祭の計算に関しては、 easter_days() - 指定した年において、3 月 21 日から復活祭までの日数を得る を参照ください。 他のマニュアルの関連ページ Python datetime P ...
https://man.mtool.work/php/8.3/function.easter-date.html
DateInterval::__construct — 新しい DateInterval オブジェクトを作成する | PHP 8.... 8382
DateInterval::__construct (PHP 5 >= 5.3.0, PHP 7, PHP 8) DateInterval::__construct — 新しい DateInterval オブジェクトを作成する 説明 public function DateInterval::__construct ( string $duration ) 新しい DateInterval オブジェクトを作成します ... DateMalformedIntervalStringException がスローされるようになりました。 8.2.0 アクセス可能なプロパティは y から f , invert , days だけになりました。 新しい boolean プロパティ from_string もアクセス可能です。 8.0.0 W が、 D と組み合わせて使えるようになり ... > int(0) ["m"]=> int(0) ["d"]=> int(9) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["f"]=> float(0) ["invert"]=> int(0) ["days"]=> bool(false) ["from_string"]=> bool(false) } 上の例の PHP 8 での出力は、このようになります。: object(DateInterval)#1 (1 ... ) ["f"]=> float(0) ["weekday"]=> int(0) ["weekday_behavior"]=> int(0) ["first_last_day_of"]=> int(0) ["invert"]=> int(0) ["days"]=> bool(false) ["special_type"]=> int(0) ["special_amount"]=> int(0) ["have_weekday_relative"]=> int(0) ["have_special_re ...
https://man.mtool.work/php/8.3/dateinterval.construct.html
日付/時刻 の算術 | PHP 8.3 8155
日付/時刻 の算術 以下の例は、DST(夏時間) への移行や、 異なった日を持つ月に関する 日付/時刻 の算術の罠をいくつか紹介します。 例1 DateTimeImmutable::add/sub は、経過時間を含む間隔を加算する DST (夏時間) への移行タイミングをまたいで PT24H を足 ... すると、(うるう年のときは) 3月2日、 または (通常の年は) 3月3日になります。 <?php echo "Normal year:\n" ; // February has 28 days $dt = new DateTimeImmutable ( "2015-01-31 00:00:00" , new DateTimeZone ( "America/New_York" )); echo "Start: " , $dt -> fo ... odify ( "+1 month" ); echo "End: " , $dt -> format ( "Y-m-d H:i:s P" ), PHP_EOL ; echo "Leap year:\n" ; // February has 29 days $dt = new DateTimeImmutable ( "2016-01-31 00:00:00" , new DateTimeZone ( "America/New_York" )); echo "Start: " , $dt -> fo ... り、オーバーフローを避けるため)、 last day of フォーマットも利用できます。 <?php echo "Normal year:\n" ; // February has 28 days $dt = new DateTimeImmutable ( "2015-01-31 00:00:00" , new DateTimeZone ( "America/New_York" )); echo "Start: " , $dt -> fo ...
https://man.mtool.work/php/8.3/datetime.examples-arithmetic.html
PREV 1 2 3 NEXT