I have today discovered the intricacies of software dates. That led me to this page which shows:
$$JD=int[365.25\; y]+int[30.6001\; (m+1)]+D+\frac{UT\_hours}{24.0}+1\,720\,981.5 \qquad$$
However, peaking at the v8 source code (the main JavaScript compiler), we see this:
// Compute modified Julian day from year, month, date.
// The missing days in 1582 are ignored for JavaScript compatibility.
function ToJulianDay(y, m, D) {
var jy = (m > 1) ? y : y - 1;
var jm = (m > 1) ? m + 2 : m + 14;
var ja = FLOOR(0.01*jy);
return FLOOR(FLOOR(365.25*jy) + FLOOR(30.6001*jm) + D + 1720995) + 2 - ja + FLOOR(0.25*ja);
}
If I can try and translate that last part into math, it would be:
$$JD=int[int[365.25*jy] + int[30.6001*jm] + D + 1720995] + 2 - ja + int[0.25*ja];$$
Compared to:
$$JD=int[365.25\; y]+int[30.6001\; (m+1)]+D+\frac{UT\_hours}{24.0}+1\,720\,981.5 \qquad$$
Why isn't it exactly the same? What are the differences? I went so far as to find Hofmann-Wellenhof, B., Lichtenegger, H., K. and Wasle, E., 2008. GNSS - Global Navigation Satellite Systems, and found it said:
The relations for date conversions are taken from Montenbruck (1984) and are slightly modified so that they are only valid for an epoch between March 1900 and February 2100.
Montenbruck looks like a German text.
So I am not quite sure. What is the correct equation for figuring out the Julian date from the current date?