Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

jdtounix()

Example

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);
?>

Definition and Usage

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.

Syntax

jdtounix(jd);

Parameter Values

Parameter

Description

jd

Required. A Julian Day Number between 2440588 and 2465342.

Technical Details

Return Value:

Returns the Unix timestamp for the beginning of the specified Julian Day.

PHP Version:

4+