The IntlCalendar class

(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL >= 3.0.0a1)



class IntlCalendar {
/* Konstanten */
const int FIELD_ERA = 0;
const int FIELD_YEAR = 1;
const int FIELD_MONTH = 2;
const int FIELD_WEEK_OF_YEAR = 3;
const int FIELD_WEEK_OF_MONTH = 4;
const int FIELD_DATE = 5;
const int FIELD_DAY_OF_YEAR = 6;
const int FIELD_DAY_OF_WEEK = 7;
const int FIELD_AM_PM = 9;
const int FIELD_HOUR = 10;
const int FIELD_HOUR_OF_DAY = 11;
const int FIELD_MINUTE = 12;
const int FIELD_SECOND = 13;
const int FIELD_MILLISECOND = 14;
const int FIELD_ZONE_OFFSET = 15;
const int FIELD_DST_OFFSET = 16;
const int FIELD_YEAR_WOY = 17;
const int FIELD_DOW_LOCAL = 18;
const int FIELD_EXTENDED_YEAR = 19;
const int FIELD_JULIAN_DAY = 20;
const int FIELD_IS_LEAP_MONTH = 22;
const int FIELD_FIELD_COUNT = 23;
const int FIELD_DAY_OF_MONTH = 5;
const int DOW_SUNDAY = 1;
const int DOW_MONDAY = 2;
const int DOW_TUESDAY = 3;
const int DOW_WEDNESDAY = 4;
const int DOW_THURSDAY = 5;
const int DOW_FRIDAY = 6;
const int DOW_SATURDAY = 7;
const int DOW_TYPE_WEEKDAY = 0;
const int DOW_TYPE_WEEKEND = 1;
const int WALLTIME_FIRST = 1;
const int WALLTIME_LAST = 0;
const int WALLTIME_NEXT_VALID = 2;
/* Methoden */
private __construct()
public add(int $field, int $value): bool
public after(IntlCalendar $other): bool
public before(IntlCalendar $other): bool
public clear(?int $field = null): bool
public static createInstance(IntlTimeZone|DateTimeZone|string|null $timezone = null, ?string $locale = null): ?IntlCalendar
public equals(IntlCalendar $other): bool
public fieldDifference(float $timestamp, int $field): int|false
public static fromDateTime(DateTime|string $datetime, ?string $locale = null): ?IntlCalendar
public get(int $field): int|false
public getActualMaximum(int $field): int|false
public getActualMinimum(int $field): int|false
public static getAvailableLocales(): array
public getDayOfWeekType(int $dayOfWeek): int|false
public getErrorCode(): int|false
public getErrorMessage(): string|false
public getFirstDayOfWeek(): int|false
public getGreatestMinimum(int $field): int|false
public static getKeywordValuesForLocale(string $keyword, string $locale, bool $onlyCommon): IntlIterator|false
public getLeastMaximum(int $field): int|false
public getLocale(int $type): string|false
public getMaximum(int $field): int|false
public getMinimalDaysInFirstWeek(): int|false
public getMinimum(int $field): int|false
public static getNow(): float
public getTime(): float|false
public getTimeZone(): IntlTimeZone|false
public getType(): string
public getWeekendTransition(int $dayOfWeek): int|false
public inDaylightTime(): bool
public isEquivalentTo(IntlCalendar $other): bool
public isLenient(): bool
public isSet(int $field): bool
public isWeekend(?float $timestamp = null): bool
public roll(int $field, int|bool $value): bool
public set(int $field, int $value): bool
public set(
    int $year,
    int $month,
    int $dayOfMonth = NULL,
    int $hour = NULL,
    int $minute = NULL,
    int $second = NULL
): bool
public setFirstDayOfWeek(int $dayOfWeek): bool
public setLenient(bool $lenient): bool
public setMinimalDaysInFirstWeek(int $days): bool
public setRepeatedWallTimeOption(int $option): bool
public setSkippedWallTimeOption(int $option): bool
public setTime(float $timestamp): bool
public setTimeZone(IntlTimeZone|DateTimeZone|string|null $timezone): bool
public toDateTime(): DateTime|false

Vordefinierte Konstanten


Calendar field numerically representing an era, for instance 1 for AD and 0 for BC in the Gregorian/Julian calendars and 235 for the Heisei (平成) era in the Japanese calendar. Not all calendars have more than one era.


Calendar field for the year. This is not unique across eras. If the calendar type has more than one era, generally the minimum value for this field will be 1.


Calendar field for the month. The month sequence is zero-based, so January (here used to signify the first month of the calendar; this may be called another name, such as Muharram in the Islamic calendar) is represented by 0, February by 1, …, December by 11 and, for calendars that have it, the 13th or leap month by 12.


Calendar field for the number of the week of the year. This depends on which day of the week is deemed to start the week and the minimal number of days in a week.


Calendar field for the number of the week of the month. This depends on which day of the week is deemed to start the week and the minimal number of days in a week.


Calendar field for the day of the month. The same as IntlCalendar::FIELD_DAY_OF_MONTH, which has a clearer name.


Calendar field for the day of the year. For the Gregorian calendar, starts with 1 and ends with 365 or 366.


Calendar field for the day of the week. Its values start with 1 (Sunday, see IntlCalendar::DOW_SUNDAY and subsequent constants) and the last valid value is 7 (Saturday).


Given a day of the week (Sunday, Monday, …), this calendar field assigns an ordinal to such a day of the week in a specific month. Thus, if the value of this field is 1 and the value of the day of the week is 2 (Monday), then the set day of the month is the 1st Monday of the month; the maximum value is 5.

Additionally, the value 0 and negative values are also allowed. The value 0 encompasses the seven days that occur immediately before the first seven days of a month (which therefore have a ‘day of week in month’ with value 1). Negative values starts counting from the end of the month – -1 points to the last occurrence of a day of the week in a month, -2 to the second last, and so on.

Unlike IntlCalendar::FIELD_WEEK_OF_MONTH and IntlCalendar::FIELD_WEEK_OF_YEAR, this value does not depend on IntlCalendar::getFirstDayOfWeek() or on IntlCalendar::getMinimalDaysInFirstWeek(). The first Monday is the first Monday, even if it occurs in a week that belongs to the previous month.


Calendar field indicating whether a time is before noon (value 0, AM) or after (1). Midnight is AM, noon is PM.


Calendar field for the hour, without specifying whether itʼs in the morning or in the afternoon. Valid values are 0 to 11.


Calendar field for the full (24h) hour of the day. Valid values are 0 to 23.


Calendar field for the minutes component of the time.


Calendar field for the seconds component of the time.


Calendar field the milliseconds component of the time.


Calendar field indicating the raw offset of the timezone, in milliseconds. The raw offset is the timezone offset, excluding any offset due to daylight saving time.


Calendar field for the daylight saving time offset of the calendarʼs timezone, in milliseconds, if active for calendarʼs time.


Calendar field representing the year for week of year purposes.


Calendar field for the localized day of the week. This is a value between 1 and 7, 1 being used for the day of the week that matches the value returned by IntlCalendar::getFirstDayOfWeek().


Calendar field for a year number representation that is continuous across eras. For the Gregorian calendar, the value of this field matches that of IntlCalendar::FIELD_YEAR for AD years; a BC year y is represented by -y + 1.


Calendar field for a modified Julian day number. It is different from a conventional Julian day number in that its transitions occur at local zone midnight rather than at noon UTC. It uniquely identifies a date.


Calendar field encompassing the information in IntlCalendar::FIELD_HOUR_OF_DAY, IntlCalendar::FIELD_MINUTE, IntlCalendar::FIELD_SECOND and IntlCalendar::FIELD_MILLISECOND. Range is from the 0 to 24 * 3600 * 1000 - 1. It is not the amount of milliseconds elapsed in the day since on DST transitions it will have discontinuities analog to those of the wall time.


Calendar field whose value is 1 for indicating a leap month and 0 otherwise.


The total number of fields.


Alias for IntlCalendar::FIELD_DATE.
















Output of IntlCalendar::getDayOfWeekType() indicating a day of week is a weekday.


Output of IntlCalendar::getDayOfWeekType() indicating a day of week belongs to the weekend.


Output of IntlCalendar::getDayOfWeekType() indicating the weekend begins during the given day of week.


Output of IntlCalendar::getDayOfWeekType() indicating the weekend ends during the given day of week.


Output of IntlCalendar::getSkippedWallTimeOption() indicating that wall times in the skipped range should refer to the same instant as wall times with one hour less and of IntlCalendar::getRepeatedWallTimeOption() indicating the wall times in the repeated range should refer to the instant of the first occurrence of such wall time.


Output of IntlCalendar::getSkippedWallTimeOption() indicating that wall times in the skipped range should refer to the same instant as wall times with one hour after and of IntlCalendar::getRepeatedWallTimeOption() indicating the wall times in the repeated range should refer to the instant of the second occurrence of such wall time.


Output of IntlCalendar::getSkippedWallTimeOption() indicating that wall times in the skipped range should refer to the instant when the daylight saving time transition occurs (begins).


Hier Kannst Du einen Kommentar verfassen

Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...


Autor : admin
Kategorie: mySQL-Tutorials

Definition von Stored Procedures - eine Einführung

Stored Procedures sind vordefinierte SQL-Codeblöcke, die in einer Datenbank gespeichert sind und bei Bedarf aufgerufen werden können. ...


Autor : ebiz-consult GmbH & Co. KG
Kategorie: mySQL-Tutorials

Wie kann man komplexe Abfragen mit SQL-Querys In MySQLi effektiv durchführen?

In diesem MySQL-Tutorial wird erklärt, wie komplexe SQL-Abfragen in MySQLi effizient durchgeführt werden können. Wir werden uns mit verschiedenen Aspekten der Datenbankabfrage beschäftigen und spezifische Methoden kennenlernen. ...


Autor : TheMax
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Berechnungen durchführen

Hallo liebe Forenmitglieder, meine erste frage ist zum Aufbau meiner kleinen Berechnungswebseite, nichts kommerzielles, soll nur eine Anwendung f ...

Geschrieben von matze511 am 21.04.2024 21:42:37
Forum: PHP Developer Forum
Professioneller Webentwickler & Webdesigner

Of course, here is the translation: Hello, Thank you for your interest in the long-term project. Your extensive skills and experience in web dev ...

Geschrieben von Athelstan am 15.04.2024 09:25:39
Forum: Jobgesuche
Wir stellen unsere SEO-Agentur vor

Hallo In der heutigen digitalen Welt war es für Unternehmen noch nie so einfach, ihre Reichweite weltweit zu vergrößern. Wenn Sie außerhalb I ...

Geschrieben von thomasmuller am 14.04.2024 07:18:33
Forum: User stellen sich vor
Spielplan für 4 Gruppen zu je 6 Teams auf 2 Feldern

Hallöchen zusammen, ich versuche derzeit unseren Excel-Spielplan in PHP zu überführen. Eigentlich bin ich auch shon fertig - wenn da nicht dies ...

Geschrieben von derH0st am 11.04.2024 15:58:37
Forum: PHP Developer Forum