Convert a Gregorian date to a Julian Day Number, and then convert that Julian Day Number to a Unix timestamp.
<?php $jd=gregoriantojd(10,3,1975); echo jdtounix($jd); ?> |
The jdtounix() function converts a Julian Day Number to a Unix timestamp.
Note: This function returns false if the Julian Day Number is not within the Unix epoch range (i.e., Gregorian years between 1970 and 2037, or Julian Day Numbers between 2440588 and 2465342). The time returned is in local time.
Tip: Use the unixtojd() function to convert a Unix timestamp to a Julian Day Number.
jdtounix(jd); |
Parameter |
Description |
jd |
Required. A Julian Day Number between 2440588 and 2465342. |
Return Value: |
Returns the Unix timestamp for the beginning of the specified Julian Day. |
PHP Version: |
4+ |