PHP | jdtofrench()函数

jdtofrench()函数是一个内置函数,用于转换 朱利安日整数 法国约会。 该函数接受一个儒略日整数,并返回转换后的法语日期 $month/$day/$year。

null

语法:

jdtofrench($jd)

参数: 该函数接受一个强制参数 $jd 它指定了朱利安日。

返回值: 函数返回法国日期。日期的返回格式为 $month/$day/$year。 如果Julian day整数被传递为0,那么0/0/0将作为输出返回。

例如:

Input : 2379254
Output : 5/8/10 

Input : 2380229
Output : 1/7/13

下面的程序演示了jdtofrench()函数。

项目1: 下面的程序演示了jdtofrench()函数的用法。

<?php
// PHP program to demonstrate the
// use of jdtofrench() function
// converts date to julian integer
$jd = frenchtojd(1, 7, 13);
// prints the julian day integer
echo "The julian day integer is " , $jd , "" ;
// converts the Julian day to French date
$date = jdtofrench( $jd );
// prints the date
echo "The french date initially taken was " , ( $date ), "" ;
?>


输出:

The julian day integer is 2380229
The french date initially taken was 1/7/13

项目2: 下面的程序显示了传递无效的Julian day整数时的输出。

<?php
// PHP program to demonstrate the
// use of jdtofrench() function
// in case of out of range parameter is passed
// converts date to julian integer
$jd = frenchtojd(1, 7, 18);
// prints the julian day integer as 0 as year is out of range
echo "The julian day integer is " , $jd , "" ;
// converts the Julian day to French date
$date = jdtofrench( $jd );
// prints the date as 0/0/0 as french year is out of range
echo "The french date initially taken was " , ( $date ), "" ;
?>


输出:

The julian day integer is 0
The french date initially taken was 0/0/0

参考: http://php.net/manual/en/function.jdtofrench.php

© 版权声明
THE END
喜欢就支持一下吧
点赞12 分享