If you need an easy way to convert an unix timestamp to a decimal julian day you can use:
$julianDay = $unixTimeStamp / 86400 + 2440587.5;
86400 is the number of seconds in a day;
2440587.5 is the julian day at 1/1/1970 0:00 UTC.
unixtojdDescriptionint unixtojd ( [int timestamp] )Return the Julian Day for a Unix timestamp (seconds since 1.1.1970), or for the current day if no timestamp is given. See also jdtounix().
add a note
User Contributed Notes
fabio at llgp dot org
31-Aug-2006 05:09
If you need an easy way to convert an unix timestamp to a decimal julian day you can use:
11-Aug-2006 10:22
Its clearly stated that this function returns the Julian Day, not Julian Day + time.
warhog at warhog d0t net
13-Jul-2005 05:11
Well, that's neither a bug, nor an interesting quirk.. The explanation is quite simple:
Mike
22-Dec-2004 12:57
Interesting quirk ... maybe bug.
johnston at capsaicin dot ca
20-Nov-2003 05:43
Also note that epoch is in UTC time (epoch is a specific point in time - epoch is not different for every time zone), so be aware of timezone complexities.
pipian at pipian dot com
13-Jun-2003 12:29
Remember that UNIX timestamps indicate a number of seconds from midnight of January 1, 1970 on the Gregorian calendar, not the Julian Calendar.
| ||