I want to calculate difference between two dates, time and secs, and I know atleast for dates converting it to two Julian Numbers and subtracting it is an efficient way. I am trying to implement this algorithm for that. Below is my implementation for today i.e. 12-22-2015
function g(y,m,d)
m = (m + 9) % 12
y = y - m/10
return 365*y + y/4 - y/100 + y/400 + (m*306 + 5)/10 + ( d - 1 )
function g(2015,12,22)
[9] m = (12 + 9) % 12
[2014.1] y = 2015 - 9/10
735146.5 + 503.525 + 20.141 + 5.03525 + 275.9 + 21
=**735954.10125**
However from this online calculation tool the correct value is: 2457378.877
.
What am I doing wrong?