English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Tutoriel PHP de base

Tutoriel PHP avancé

PHP & MySQL

Manuel de référence PHP

Manuel des fonctions PHP Calendar

L'extension du calendrier fournit une série de fonctionnalités pour simplifier la conversion entre différents formats de calendrier.

Introduction à PHP Calendar

L'extension du calendrier contient des fonctions pour simplifier la conversion entre différents formats de calendrier.

Il est basé sur le compte des jours juliens (compte des jours juliens), à partir de 4713 Année 1 Month 1 commencer par le jour.

Remarque :Pour convertir entre des formats de calendrier, il est nécessaire de convertir d'abord en compte des jours juliens, puis en format de calendrier souhaité.

Remarque :Julian Day Count (compte des jours juliens) et Julian Calendar (calendrier julien) ne font pas référence à la même chose !

installer

Pour que ces fonctions puissent fonctionner, vous devez --activer-compiler PHP avec calendar

La version Windows de PHP inclut nativement le support de l'extension de calendrier. Par conséquent, les fonctions Calendar fonctionnent automatiquement.

Fonctions Calendar PHP

FonctionDescription
cal_days_in_month()Retourner le nombre de jours dans un mois pour une année et un calendrier spécifique.
cal_from_jd()Convertir le compte des jours juliens en date du calendrier spécifique.
cal_info()Retourner des informations sur le calendrier spécifique.
cal_to_jd()Convertir une date d'un calendrier spécifique en compte des jours juliens.
easter_date()Return the Unix timestamp of Easter midnight for the specified year.
easter_days()Return the date of Easter for the specified year and 3 Month 21 Days between two dates.
frenchtojd()Convert French Republican date to Julian day count.
gregoriantojd()Convert Gregorian date to Julian day count.
jddayofweek()Return the day of the week for the date.
jdmonthname()Return the name of the month.
jdtofrench()Convert Julian day count to French Republican date.
jdtogregorian()Convert Julian day count to Gregorian date.
jdtojewish()Convert Julian day count to Jewish date.
jdtojulian()Convert Julian day count to Julian date.
jdtounix()Convert Julian day count to Unix timestamp.
jewishtojd()Convert Jewish date to Julian day count.
juliantojd()Convert Julian date to Julian day count.
unixtojd()Convert Unix timestamp to Julian day count.

PHP predefined Calendar constants

ConstantTypePHP version
CAL_GREGORIANIntegerPHP 4
CAL_JULIANIntegerPHP 4
CAL_JEWISHIntegerPHP 4
CAL_FRENCHIntegerPHP 4
CAL_NUM_CALSIntegerPHP 4
CAL_DOW_DAYNOIntegerPHP 4
CAL_DOW_SHORTIntegerPHP 4
CAL_DOW_LONGIntegerPHP 4
CAL_MONTH_GREGORIAN_SHORTIntegerPHP 4
CAL_MONTH_GREGORIAN_LONGIntegerPHP 4
CAL_MONTH_JULIAN_SHORTIntegerPHP 4
CAL_MONTH_JULIAN_LONGIntegerPHP 4
CAL_MONTH_JEWISHIntegerPHP 4
CAL_MONTH_FRENCHIntegerPHP 4
CAL_EASTER_DEFAULTIntegerPHP 4.3
CAL_EASTER_ROMANIntegerPHP 4.3
CAL_EASTER_ALWAYS_GREGORIANIntegerPHP 4.3
CAL_EASTER_ALWAYS_JULIANIntegerPHP 4.3
CAL_JEWISH_ADD_ALAFIM_GERESHIntegerPHP 5.0
CAL_JEWISH_ADD_ALAFIMIntegerPHP 5.0
CAL_JEWISH_ADD_GERESHAYIMIntegerPHP 5.0