小白教程
所有教程
关于
Search
172.70.174.27
172.70.174.27
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“PHP Calendar 函数”的源代码
本页内容
上一节:
PHP_Array_函数
下一节:
PHP_Date/Time_函数
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:PHP Calendar}}[[Category:PHP 教程|71]] = PHP Calendar 函数 = == PHP Calendar 简介 == 日历扩展包含了简化不同日历格式间的转换的函数。 '''它是基于 Julian Day Count(儒略日计数),是从公元前 4713 年 1 月 1 日开始计算的。''' '''注释:'''如需在日历格式之间转换,必须首先转换为 Julian Day Count,然后再转换为您需要的日历格式。 '''注释:'''Julian Day Count(儒略日计数)与 Julian Calendar(儒略历法) 不是一回事! == 安装 == 为了让这些函数能够工作,您必须通过 --enable-calendar 编译 PHP。 PHP 的 Windows 版本已内建了对日历扩展的支持。因此,Calendar 函数会自动工作。 == PHP 5 Calendar 函数 == {| class="table table-striped table-hover" ! 函数 ! 描述 |- | [[func cal cal days in month|cal_days_in_month()]] | 针对指定的年份和历法,返回一个月中的天数。 |- | [[func cal cal from jd|cal_from_jd()]] | 把儒略日计数转换为指定历法的日期。 |- | [[func cal cal info|cal_info()]] | 返回有关指定历法的信息。 |- | [[func cal cal to jd|cal_to_jd()]] | 把指定历法的日期转换为儒略日计数。 |- | [[func cal easter date|easter_date()]] | 返回指定年份的复活节午夜的 Unix 时间戳。 |- | [[func cal easter days|easter_days()]] | 返回指定年份的复活节与 3 月 21 日之间的天数。 |- | [[func cal frenchtojd|frenchtojd()]] | 把法国共和历法的日期转换成为儒略日计数。 |- | [[func cal gregoriantojd|gregoriantojd()]] | 把格利高里历法的日期转换成为儒略日计数。 |- | [[func cal jddayofweek|jddayofweek()]] | 返回日期在周几。 |- | [[func cal jdmonthname|jdmonthname()]] | 返回月的名称。 |- | [[func cal jdtofrench|jdtofrench()]] | 把儒略日计数转换为法国共和历法的日期。 |- | [[func cal jdtogregorian|jdtogregorian()]] | 把儒略日计数转换为格利高里历法的日期。 |- | [[func cal jdtojewish|jdtojewish()]] | 把儒略日计数转换为犹太历法的日期。 |- | [[func cal jdtojulian|jdtojulian()]] | 把儒略日计数转换为儒略历法的日期。 |- | [[func cal jdtounix|jdtounix()]] | 把儒略日计数转换为 Unix 时间戳。 |- | [[func cal jewishtojd|jewishtojd()]] | 把犹太历法的日期转换为儒略日计数。 |- | [[func cal juliantojd|juliantojd()]] | 把儒略历法的日期转换为儒略日计数。 |- | [[func cal unixtojd|unixtojd()]] | 把 Unix 时间戳转换为儒略日计数。 |} == PHP 5 预定义的 Calendar 常量 == {| class="table table-striped table-hover" ! 常量 ! 类型 ! PHP 版本 |- | CAL_GREGORIAN | Integer | PHP 4 |- | CAL_JULIAN | Integer | PHP 4 |- | CAL_JEWISH | Integer | PHP 4 |- | CAL_FRENCH | Integer | PHP 4 |- | CAL_NUM_CALS | Integer | PHP 4 |- | CAL_DOW_DAYNO | Integer | PHP 4 |- | CAL_DOW_SHORT | Integer | PHP 4 |- | CAL_DOW_LONG | Integer | PHP 4 |- | CAL_MONTH_GREGORIAN_SHORT | Integer | PHP 4 |- | CAL_MONTH_GREGORIAN_LONG | Integer | PHP 4 |- | CAL_MONTH_JULIAN_SHORT | Integer | PHP 4 |- | CAL_MONTH_JULIAN_LONG | Integer | PHP 4 |- | CAL_MONTH_JEWISH | Integer | PHP 4 |- | CAL_MONTH_FRENCH | Integer | PHP 4 |- | CAL_EASTER_DEFAULT | Integer | PHP 4.3 |- | CAL_EASTER_ROMAN | Integer | PHP 4.3 |- | CAL_EASTER_ALWAYS_GREGORIAN | Integer | PHP 4.3 |- | CAL_EASTER_ALWAYS_JULIAN | Integer | PHP 4.3 |- | CAL_JEWISH_ADD_ALAFIM_GERESH | Integer | PHP 5.0 |- | CAL_JEWISH_ADD_ALAFIM | Integer | PHP 5.0 |- | CAL_JEWISH_ADD_GERESHAYIM | Integer | PHP 5.0 |}
返回至“
PHP Calendar 函数
”。
上一节:
PHP_Array_函数
下一节:
PHP_Date/Time_函数