jdtounix

(PHP 4, PHP 5, PHP 7)

jdtounix Переводит число дней в Юлианском летоисчислении в метку времени Unix

Описание

int jdtounix ( int $jday )

Эта функция вернет метку времени Unix соответствующую номеру дня в Юлианском летоисчислении, заданному в jday либо FALSE, если jday лежит за пределами эпохи Unix (годы по Григорианскому календарю между 1970 и 2037 или 2440588 <= jday <= 2465342 ). Будет возвращено локальное время (не GMT).

Список параметров

jday

Номер дня в Юлианском летоисчислении между 2440588 и 2465342.

Возвращаемые значения

Метка времени Unix на момент начала юлианского дня.

Смотрите также

  • unixtojd() - Переводит метку времени Unix в Юлианский день

Коментарии

Remember that UNIX timestamps indicate a number of seconds from midnight of January 1, 1970 on the Gregorian calendar, not the Julian Calendar.
2003-06-12 12:29:05
http://php5.kiev.ua/manual/ru/function.jdtounix.html
Remember that unixtojd() assumes your timestamp is in GMT, but jdtounix() returns a timestamp in localtime.

This fooled me a few times. 

So if you have:

$timestamp1 = time();
$timestamp2 = jdtounix(unixtojd($timestamp1));

Unless your localtime is the same as GMT, $timestamp1 will not equal $timestamp2.
2003-10-21 15:10:23
http://php5.kiev.ua/manual/ru/function.jdtounix.html
Автор:
Warning: the calender functions involving julian day operations seem to ignore the decimal part of the julian day count.

This means that the returned date is wrong 50% of the time, since a julian day starts at decimal .5 .  Take care!!
2005-01-27 08:50:50
http://php5.kiev.ua/manual/ru/function.jdtounix.html
If you need an easy way to convert a decimal julian day to an unix timestamp you can use:

$unixTimeStamp = ($julianDay - 2440587.5) * 86400;

2440587.5 is the julian day at 1/1/1970 0:00 UTC
86400 is the number of seconds in a day
2006-08-31 05:14:38
http://php5.kiev.ua/manual/ru/function.jdtounix.html
Автор:
unixtojd() assumes that your timestamp is in GMT, but jdtounix() returns a timestamp in localtime.
so
<?php
$d1
=jdtogregorian(unixtojd(time()));
$d2gmdate("m/d/Y");
$d3=date("m/d/Y");
?>
$d1 always equals $d2 but $d1 may differ from $d3
2014-10-22 21:11:43
http://php5.kiev.ua/manual/ru/function.jdtounix.html

    Поддержать сайт на родительском проекте КГБ