Convert unix timestamp to julian

后端 未结 3 1998
迷失自我
迷失自我 2020-12-30 02:19

How can I convert from a unix timestamp (say 1232559922) to a fractional julian date (2454853.03150).

I found a website ( http://aa.usno.navy.mil/data/docs/JulianDat

3条回答
  •  萌比男神i
    2020-12-30 02:31

    The Unix epoch (zero-point) is January 1, 1970 GMT. That corresponds to the Julian day of 2440587.5

    So, in pseudo-code:

    function float getJulianFromUnix( int unixSecs )
    {
       return ( unixSecs / 86400.0 ) + 2440587.5;
    }
    

提交回复
热议问题