当前位置: 首页 > 网络学院 > 服务端脚本教程 > PHP > JulianToJD() 函数

PHP
PHP 介绍
PHP 安装
PHP 语法
PHP 变量
PHP操作符
PHP If...Else
PHP Switch
PHP 数组
PHP 循环
PHP 函数
PHP 表单
PHP $_GET
PHP $_POST
PHP Date
PHP Include
PHP 文件处理
PHP 文件上传
PHP Cookies
PHP Sessions
PHP 发送邮件

PHP 中的 JulianToJD() 函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 461 ::
收藏到网摘: n/a

Definition and Usage
定义和用法

The JulianToJD() function converts a Julian calendar date to a Julian day count.
JulianToJD()函数的作用是:将罗马儒略历转为儒略日计数。

Syntax
语法

juliantojd(month,day,year)

Parameter
参数
Description
描述
month Required. Specifies the month
必要参数。指定月份
day Required. Specifies the day
必要参数。指定日
year Required. Specifies the year. Valid range is 4713 B.C. to 9999 A.D.
必要参数。指定年份,有效范围从公元前4714年到公元后9999年


Tips and Notes
注意点

Note: Although this function can handle dates back to 4713 B.C., you should notice that the Julian calendar was created in 46 B.C., and it did not stabilize until at least 8 A.D. Also, the beginning of a year varied from one culture to another - not all accepted January as the first month. Remember that the current calendar being used worldwide is the Gregorian calendar. The gregoriantojd() function can be used to convert such dates to their Julian Day count.
注意:尽管这个函数可以处理直到公元前4713年的日期,你也应该要知道:儒略历是在公元前46年创建的,它知道公元后8年才被确立使用。而且,关于年份起源的定义是根据文化的不同而不同的,并不是所有的文化中都以1月份[January]为一年当中的第一个月的。请记住:现在全球通用的是格里高里历[Gregorian calendar]。gregoriantojd()函数可以用于将格里高里历转化为它所对应的儒略历日计数[Julian Day count]。


Example
案例

<?php
$jd = juliantojd(10,3,1975);
echo($jd . "<br />");
$julian = jdtojulian($jd);
echo($julian);
?>

The output of the code above will be:
上述代码将输出下面的结果:

2442702
10/3/1975

评论 (0) All

登陆 | 还没注册?