unixtojd


php apg

CONVERTS a UNIX timestamp to a Julian Day Number, (JDN).



<?php

int
|false unixtojd int|null $timestamp null )


where,

$timestamp A UNIX timestamp to convert

?>

 $timestamp 


A UNIX timestamp to convert.





This function returns the Julian Day Number, (JDN) in the given $timestamp since 01/01/1970.

If no $timestamp is given the current Julian Day Number, (JDN).

Either way, the time is regarded as local time (not UTC).

Since PHP 8.0.0 the $timestamp is nullable.



  1 EXERCISE   

<?php

$unixtsa 
0;

$unixtsb 2138745600;

$unix2jda unixtojd($unixtsa);

$unix2jdb unixtojd($unixtsb);

echo 
$unixtsa '<sub>UNIX Timestamp</sub> => ' 
$unix2jda '<sub>JDN</sub><br><br>';

echo 
$unixtsb '<sub>UNIX Timestamp</sub> => ' 
$unix2jdb '<sub>JDN</sub>';

?>