PHP 5 Calendar 函数
PHP 函数 calendar
2023-09-11 14:14:38 时间
PHP 5 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 函数
函数 | 描述 |
---|---|
cal_days_in_month() | 针对指定的年份和历法,返回一个月中的天数。 |
cal_from_jd() | 把儒略日计数转换为指定历法的日期。 |
cal_info() | 返回有关指定历法的信息。 |
cal_to_jd() | 把指定历法的日期转换为儒略日计数。 |
easter_date() | 返回指定年份的复活节午夜的 Unix 时间戳。 |
easter_days() | 返回指定年份的复活节与 3 月 21 日之间的天数。 |
frenchtojd() | 把法国共和历法的日期转换成为儒略日计数。 |
gregoriantojd() | 把格利高里历法的日期转换成为儒略日计数。 |
jddayofweek() | 返回日期在周几。 |
jdmonthname() | 返回月的名称。 |
jdtofrench() | 把儒略日计数转换为法国共和历法的日期。 |
jdtogregorian() | 把儒略日计数转换为格利高里历法的日期。 |
jdtojewish() | 把儒略日计数转换为犹太历法的日期。 |
jdtojulian() | 把儒略日计数转换为儒略历法的日期。 |
jdtounix() | 把儒略日计数转换为 Unix 时间戳。 |
jewishtojd() | 把犹太历法的日期转换为儒略日计数。 |
juliantojd() | 把儒略历法的日期转换为儒略日计数。 |
unixtojd() | 把 Unix 时间戳转换为儒略日计数。 |
PHP 5 预定义的 Calendar 常量
常量 | 类型 | 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使用mysqli连接MySQL数据库
- php file()函数
- PHP 杂项函数
- PHP FTP函数
- PHP抓取网页获取特定信息
- PHP 数组排序:内置函数、算法排序
- PHP字符串函数 number_format(以千位分隔符方式格式化一个数字)
- PHP函数只传递指定的参数
- php多进程使用
- PHP常用函数总结表
- PHP 反射
- PHP生成订单号函数
- PHP获取指定函数定义在哪个文件中及行号
- 如何启用 Apache 的 PHP-FPM 多实例
- 腾讯云服务器搭建Apache/PHP/MySQL环境
- PHP 闭包函数
- PHP 多个文件上传
- PHP fwrite() 函数与 file_put_contents() 函数的比较
- PHP的数组排序函数
- PHP list() 函数
- PHP – 在类中使用array_filter时回调函数的问题
- php中用file_get_contents函数获取带BOM的utf-8文件内容
- [安全]PHP能引起安全的函数
- php函数serialize()与unserialize()
- 牛人写的facebook优化php来龙去脉
- PHP防抓取数据curl 解决方法
- 简单说明PHP的垃圾收集机制是怎样的?【转】
- php源码安全加密之PHP混淆算法.