unixtojd

int unixtojd([int timestamp]) 

Converts a UNIX timestamp to a Julian day count.

Returns:

Julian day count

Description:

unixtojd() converts a UNIX timestamp to a Julian day count. If no timestamp is given, the function returns the Julian day count for the current timestamp.

Warning:

As of PHP 4.0.4, this function behaves oddly if given a timestamp less than 0. Filtering the input to ensure that a valid timestamp is being passed to the function is a good idea.

Version:

Available in PHP 4.0.0 RC 2

See also:

To convert a Julian day count to a UNIX timestamp date:

jdtounix() 

To convert a Julian day count to another calendar system, see the jdto* functions

Examples:

Display the Julian day count that corresponds to the UNIX epoch
 echo ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.