IntlCalendar クラス
(PHP 5 >= 5.5.0, PHP 7, PECL >= 3.0.0a1)
はじめに
クラス概要
$key
, string $locale
, bool $commonlyUsed
) : Iterator$key
, string $locale
, bool $commonlyUsed
) : Iterator$year
, int $month
[, int $dayOfMonth = NULL
[, int $hour = NULL
[, int $minute = NULL
[, int $second = NULL
]]]] ) : bool$cal
, int $year
, int $month
[, int $dayOfMonth = NULL
[, int $hour = NULL
[, int $minute = NULL
[, int $second = NULL
]]]] ) : bool定義済み定数
IntlCalendar::FIELD_ERA-
カレンダーのフィールドで、時代を表す数値です。たとえば、グレゴリオ暦やユリウス暦の場合は 1 が紀元後そして 0 が紀元前を表します。 また、和暦の場合は 235 が平成を表します。 すべてのカレンダーが複数の時代を持つわけではありません。
IntlCalendar::FIELD_YEAR-
カレンダーの、年を表すフィールド。時代が違えば同じ数字になることもあります。 そのカレンダー型が複数の時代を持っている場合は、このフィールドの最小値は通常は 1 になります。
IntlCalendar::FIELD_MONTH-
カレンダーの、月を表すフィールド。月番号はゼロからはじまるので、1月が 0、2月が 1、…そして12月が 11 となります。13番目の月あるいはうるう月があるカレンダーの場合は、12 で表します。
IntlCalendar::FIELD_WEEK_OF_YEAR-
カレンダーの、年内の週番号を表すフィールド。 これは、何曜日を週の開始日とみなすか、そして週の最小日数は何日かによって決まります。
IntlCalendar::FIELD_WEEK_OF_MONTH-
カレンダーの、月内の週番号を表すフィールド。 これは、何曜日を週の開始日とみなすか、そして週の最小日数は何日かによって決まります。
IntlCalendar::FIELD_DATE-
カレンダーの、月内の日数を表すフィールド。
IntlCalendar::FIELD_DAY_OF_MONTHと同じで、こちらのほうがよりわかりやすい名前です。 IntlCalendar::FIELD_DAY_OF_YEAR-
カレンダーの、年内の日数を表すフィールド。 グレゴリオ暦の場合は、
1から始まって365あるいは366で終わります。 IntlCalendar::FIELD_DAY_OF_WEEK-
カレンダーの、曜日を表すフィールド。 最初の値は 1 (日曜日。
IntlCalendar::DOW_SUNDAYとそれに続く定数を参照ください) で、有効な最後の値は 7 (土曜日) です。 IntlCalendar::FIELD_DAY_OF_WEEK_IN_MONTH-
曜日 (日曜日、月曜日、…) を指定されたときに、このフィールドには当月内でその曜日が何番目に登場するのかを代入します。 つまり、このフィールドの値が 1 で曜日番号が 2 (月曜日) だったとすると、 当月の第一月曜日の日付が設定されます。 最大値は 5 です。
さらに、0 や負の数も使えます。 0 は、ある月の最初の (day of week in month の値が 1 となる) 七日間の直前の七日間を表します。 負の値を指定した場合は、月末から数えます。-1 は、その曜日が当月の最後に登場する日付、 -2 はさらにその一週間前といったようになります。
IntlCalendar::FIELD_WEEK_OF_MONTHやIntlCalendar::FIELD_WEEK_OF_YEARとは異なり、この値は IntlCalendar::getFirstDayOfWeek() や IntlCalendar::getMinimalDaysInFirstWeek() に依存しません。 第一月曜日は第一月曜日であり、たとえ前月に属する日であってもそれは変わりません。 IntlCalendar::FIELD_AM_PM-
カレンダーの、午前 (0) か午後 (1) かを表すフィールド。 深夜 0 時は午前、正午は午後となります。
IntlCalendar::FIELD_HOUR-
カレンダーの、時間を表すフィールド。午前か午後かは含みません。 有効な値は 0 から 11 までです。
IntlCalendar::FIELD_HOUR_OF_DAY-
カレンダーの、24 時間制の時間を表すフィールド。 有効な値は 0 から 23 までです。
IntlCalendar::FIELD_MINUTE-
カレンダーの、分を表すフィールド。
IntlCalendar::FIELD_SECOND-
カレンダーの、秒を表すフィールド。
IntlCalendar::FIELD_MILLISECOND-
カレンダーの、ミリ秒を表すフィールド。
IntlCalendar::FIELD_ZONE_OFFSET-
カレンダーの、タイムゾーンのオフセットをミリ秒で表すフィールド。 夏時間によるオフセットは含みません。
IntlCalendar::FIELD_DST_OFFSET-
カレンダーの、夏時間によるオフセットをミリ秒で表すフィールド。 夏時間を採用しているタイムゾーンの場合に使います。
IntlCalendar::FIELD_YEAR_WOY-
カレンダーの、week of year 用の年を表すフィールド。
IntlCalendar::FIELD_DOW_LOCAL-
カレンダーの、ローカライズした曜日を表すフィールド。 1 から 7 までの値となり、 1 は IntlCalendar::getFirstDayOfWeek() が返す値にマッチする曜日に使います。
IntlCalendar::FIELD_EXTENDED_YEAR-
カレンダーの、年番号を表すフィールド。この番号は、時代をまたがって続きます。 グレゴリオ暦の場合、紀元後の年についてはこの値は
IntlCalendar::FIELD_YEARに一致します。 紀元前 y 年の場合は -y + 1 となります。 IntlCalendar::FIELD_JULIAN_DAY-
カレンダーの、ユリウス日を表すフィールド。 一般的な慣習とは違って、このユリウス日は現地時間の深夜 0 時に加算されます。 UTC の正午ではありません。 これで、日付を一意に特定します。
IntlCalendar::FIELD_MILLISECONDS_IN_DAY-
カレンダーの、
IntlCalendar::FIELD_HOUR_OF_DAYやIntlCalendar::FIELD_MINUTE、IntlCalendar::FIELD_SECOND、そしてIntlCalendar::FIELD_MILLISECONDの情報をまとめたフィールド。 0 から 24 * 3600 * 1000 - 1 までの値となります。この値は、その日の中での経過ミリ秒数ではありません。 というのも、夏時間への移行を挟む場合はこの値は連続した値にならないからです。 IntlCalendar::FIELD_IS_LEAP_MONTH-
カレンダーのフィールドで、値が 1 のときはうるう月、 0 の場合はそうでないことを表します。
IntlCalendar::FIELD_FIELD_COUNT-
フィールドの総数。
IntlCalendar::FIELD_DAY_OF_MONTH-
IntlCalendar::FIELD_DATEのエイリアス。 IntlCalendar::DOW_SUNDAY-
日曜日。
IntlCalendar::DOW_MONDAY-
月曜日。
IntlCalendar::DOW_TUESDAY-
火曜日。
IntlCalendar::DOW_WEDNESDAY-
水曜日。
IntlCalendar::DOW_THURSDAY-
木曜日。
IntlCalendar::DOW_FRIDAY-
金曜日。
IntlCalendar::DOW_SATURDAY-
土曜日。
IntlCalendar::DOW_TYPE_WEEKDAY-
平日であることを示す IntlCalendar::getDayOfWeekType() の出力。
IntlCalendar::DOW_TYPE_WEEKEND-
週末であることを示す IntlCalendar::getDayOfWeekType() の出力。
IntlCalendar::DOW_TYPE_WEEKEND_OFFSET-
指定した曜日から週末が始まることを示す IntlCalendar::getDayOfWeekType() の出力。
IntlCalendar::DOW_TYPE_WEEKEND_CEASE-
指定した曜日で週末が終わることを示す IntlCalendar::getDayOfWeekType() の出力。
IntlCalendar::WALLTIME_FIRST-
スキップした範囲内の実測時間が一時間前の実測時間と同じ瞬間を指すことを示す IntlCalendar::getSkippedWallTimeOption() の出力。 また、繰り返した範囲内の実測時間がその最初のほうを指すことを示す IntlCalendar::getRepeatedWallTimeOption() の出力。
IntlCalendar::WALLTIME_LAST-
スキップした範囲内の実測時間が一時間後の実測時間と同じ瞬間を指すことを示す IntlCalendar::getSkippedWallTimeOption() の出力。 また、繰り返した範囲内の実測時間がその二番目のほうを指すことを示す IntlCalendar::getRepeatedWallTimeOption() の出力。
IntlCalendar::WALLTIME_NEXT_VALID-
スキップした範囲内の実測時間が夏時間への移行 (開始) を指すことを示す IntlCalendar::getSkippedWallTimeOption() の出力。
目次
- IntlCalendar::add — Add a (signed) amount of time to a field
- IntlCalendar::after — Whether this objectʼs time is after that of the passed object
- IntlCalendar::before — Whether this objectʼs time is before that of the passed object
- IntlCalendar::clear — Clear a field or all fields
- IntlCalendar::__construct — Private constructor for disallowing instantiation
- IntlCalendar::createInstance — Create a new IntlCalendar
- IntlCalendar::equals — Compare time of two IntlCalendar objects for equality
- IntlCalendar::fieldDifference — Calculate difference between given time and this objectʼs time
- IntlCalendar::fromDateTime — Create an IntlCalendar from a DateTime object or string
- IntlCalendar::get — Get the value for a field
- IntlCalendar::getActualMaximum — The maximum value for a field, considering the objectʼs current time
- IntlCalendar::getActualMinimum — The minimum value for a field, considering the objectʼs current time
- IntlCalendar::getAvailableLocales — Get array of locales for which there is data
- IntlCalendar::getDayOfWeekType — Tell whether a day is a weekday, weekend or a day that has a transition between the two
- IntlCalendar::getErrorCode — Get last error code on the object
- IntlCalendar::getErrorMessage — Get last error message on the object
- IntlCalendar::getFirstDayOfWeek — Get the first day of the week for the calendarʼs locale
- IntlCalendar::getGreatestMinimum — Get the largest local minimum value for a field
- IntlCalendar::getKeywordValuesForLocale — Get set of locale keyword values
- IntlCalendar::getLeastMaximum — Get the smallest local maximum for a field
- IntlCalendar::getLocale — Get the locale associated with the object
- IntlCalendar::getMaximum — Get the global maximum value for a field
- IntlCalendar::getMinimalDaysInFirstWeek — Get minimal number of days the first week in a year or month can have
- IntlCalendar::getMinimum — Get the global minimum value for a field
- IntlCalendar::getNow — Get number representing the current time
- IntlCalendar::getRepeatedWallTimeOption — Get behavior for handling repeating wall time
- IntlCalendar::getSkippedWallTimeOption — Get behavior for handling skipped wall time
- IntlCalendar::getTime — Get time currently represented by the object
- IntlCalendar::getTimeZone — Get the objectʼs timezone
- IntlCalendar::getType — Get the calendar type
- IntlCalendar::getWeekendTransition — Get time of the day at which weekend begins or ends
- IntlCalendar::inDaylightTime — Whether the objectʼs time is in Daylight Savings Time
- IntlCalendar::isEquivalentTo — Whether another calendar is equal but for a different time
- IntlCalendar::isLenient — Whether date/time interpretation is in lenient mode
- IntlCalendar::isSet — Whether a field is set
- IntlCalendar::isWeekend — Whether a certain date/time is in the weekend
- IntlCalendar::roll — Add value to field without carrying into more significant fields
- IntlCalendar::set — Set a time field or several common fields at once
- IntlCalendar::setFirstDayOfWeek — Set the day on which the week is deemed to start
- IntlCalendar::setLenient — Set whether date/time interpretation is to be lenient
- IntlCalendar::setMinimalDaysInFirstWeek — Set minimal number of days the first week in a year or month can have
- IntlCalendar::setRepeatedWallTimeOption — Set behavior for handling repeating wall times at negative timezone offset transitions
- IntlCalendar::setSkippedWallTimeOption — Set behavior for handling skipped wall times at positive timezone offset transitions
- IntlCalendar::setTime — Set the calendar time in milliseconds since the epoch
- IntlCalendar::setTimeZone — Set the timezone used by this calendar
- IntlCalendar::toDateTime — Convert an IntlCalendar into a DateTime object