jdtounixCONVERTS a
Julian Day Number, (JDN) to a
UNIX timestamp.
<?php
int jdtounix ( int $julian_day )
where,
$julian_day = A Julian Day Number, (JDN)
?>
$julian_day
A Julian Day Number, (JDN).
This function returns a UNIX timestamp corresponding to the Julian Day Number, (JDN) given in $julian_day or ValueError if $julian_day is outside the UNIX epoch.
32 bit systems:
$julian_day ∈ [2440588, 2465343].
64 bit systems:
$julian_day ∈ [2440588, 106751993607888].
<?php
ValueError extends Error {
/* Inherited properties */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* Inherited methods */
final public Error::getMessage ( ) : string
final public Error::getPrevious ( ) : Throwable|null
final public Error::getCode ( ) : mixed
final public Error::getFile ( ) : string
final public Error::getLine ( ) : int
final public Error::getTrace ( ) : array
final public Error::getTraceAsString ( ) : string
public Error::__toString ( ) : string
final private Error::__clone ( ) : void
}
?>
EXERCISE
<?php
$jdc01a = 2440588;
$jdc01b = 2465343;
//32 bit
$jd2unix01a = jdtounix($jdc01a);
$getdate01a = getdate($jd2unix01a);
$jd2unix01b = jdtounix($jdc01b);
$getdate01b = getdate($jd2unix01b);
echo $jdc01a . '<sub>JDC</sub> => ' . $jd2unix01a .
'<sub>UNIX Timestamp</sub> => ' . $getdate01a['month'] . '/' .
$getdate01a['mday'] . '/' . $getdate01a['year'] .
'<sub>(month/day/year) Gregorian Calendar</sub><br><br><br>';
echo $jdc01b . '<sub>JDC</sub> => ' . $jd2unix01b .
'<sub>UNIX Timestamp</sub> => ' . $getdate01b['month'] . '/' .
$getdate01b['mday'] . '/' . $getdate01b['year'] .
'<sub>(month/day/year) Gregorian Calendar</sub>';
?>
EXERCISE
<?php
$jdc02a = 2440588;
$jdc02b = 106751993607888;
// 64 bit
$jd2unix02a = jdtounix($jdc02a);
$getdate02a = getdate($jd2unix02a);
$jd2unix02b = jdtounix($jdc02b);
$getdate02b = getdate($jd2unix02b);
echo $jdc02a . '<sub>JDC</sub> => ' . $jd2unix02a .
'<sub>UNIX Timestamp</sub> => ' . $getdate02a['month'] . '/' .
$getdate02a['mday'] . '/' . $getdate02a['year'] .
'<sub>(month/day/year) Gregorian Calendar</sub><br><br><br>';
echo $jdc02b . '<sub>JDC</sub> => ' . $jd2unix02b .
'<sub>UNIX Timestamp</sub> => ' . $getdate02b['month'] . '/' .
$getdate02b['mday'] . '/' . $getdate02b['year'] .
'<sub>(month/day/year) Gregorian Calendar</sub>';
?>