PHP jdtounix()Functions
Examples
Convert a Gregorian date to a Julian Day Count, and then convert the Julian Day Count to a Unix timestamp:
<?php
$jd=gregoriantojd(10,3,1975);
echo jdtounix($jd);
?>
$jd=gregoriantojd(10,3,1975);
echo jdtounix($jd);
?>
Run example »
Definition and Usage
The jdtounix() function converts a Julian Day Count to a Unix timestamp.
Note:If the parameterjdis outside the Unix epoch (meaning the Gregorian year must be between 1970 and 2037, or jd >= 2440588 and jd <= 2465342), this function will return false. The returned time is local time.
Tip:See alsounixtojd()converts a Unix timestamp to a Julian Day Count.
Syntax
jdtounix(jd);
| Parameter | Description |
|---|---|
| jd | Required. A Julian day number between 2440588 and 2465342. |
Technical Details
| Return value: | Returns the Unix timestamp at the start of the specified Julian day. |
|---|---|
| PHP Version: | 4+ |
PHP Calendar Reference Manual Other Extensions