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

unixtojd()

Example

Convert a Unix timestamp to a Julian Day Number.

<?php
echo unixtojd();
?>

Definition and Usage

The unixtojd() function converts a Unix timestamp to a Julian Day Number.

Note: A Unix timestamp represents the number of seconds elapsed since midnight on January 1, 1970 (Gregorian Calendar).

Tip: Use the jdtounix() function to convert a Julian Day Number to a Unix timestamp.

Syntax

unixtojd(timestamp);

Parameter Values

Parameter

Description

timestamp

Optional. Specifies the Unix timestamp to be converted.

Technical Details

 

Return Value:

Returns the Julian Day Number for a given Unix timestamp (seconds since January 1, 1970), or for the current day if no timestamp is provided.

PHP Version:

4+