php8.5
Home/ Manual/ calendar / functions/ unixtojd

unixtojd

PHP function Edit on GitHub ✎

(PHP 4, PHP 5, PHP 7, PHP 8)

Convert Unix timestamp to Julian Day

Description

unixtojd(int|null $timestamp = null): int|false

Return the Julian Day for a Unix timestamp (seconds since 1.1.1970), or for the current day if no timestamp is given. Either way, the time is regarded as local time (not UTC).

Parameters

timestamp

A unix timestamp to convert.

Return Values

A julian day number as integer, Falseforfailure.

Changelog

VersionDescription
8.0.0timestamp is nullable now.

See Also

Source: reference/calendar/functions/unixtojd.xml · from the official PHP manual (php/doc-en)