c++ - How to compute julian arithmetic -
i have problem need find difference between 18-digit current julian-timestamp , constant amount of minutes , result should 18-digit julian timestamp again.
now have lib provided api 18-digit current julian-timestamp, not able find simple way compute rest.
j = 18-digit current julian-timestamp; /* have */ m = integer, indicates number of minutes elapsed. j-m = r 18-digit julian-timestamp
please suggest simplified way compute r.
the common usage store julian dates in double. according julian day on wikipedia, julian day january 1, 2000 12:00 ut 2,451,545. need 7 decimal digits process day. since double has precision of 13 decimal digits, still left 6 decimal digits fraction of day. day contains 86400 seconds, julian day contained in float can represent dates since noon on january 1, 4713 bc, in proleptic julian calendar precision of @ least 1 second.
and julian period (same reference) *a chronological interval of 7980 years beginning 4713 bc, can still represent 2000 years starting now.
so should convert timestamp double, add (double) m / 1440.
, new julian timestamp.
if later want convert julian day in our gregorian calendar have use difference january 1, 2000 12:00 ut 2,451,545
Comments
Post a Comment