Thanks for the feedback Jose,
I developed this code so that dates after 1900 but before before 2000 could be properly dealt with by Excel when cutting and pasting data from MS charts into Excel. (I later learnt that Excel has some serious date issues, hence the limit for 1900 and the correction factors. <sarcasm>Thanks Mr W. Gates et. al. </sarcasm> )
If you want to export, say the Dow Jones to Excel (or any other instrument that has data prior to 01 Jan 1900) then you have other problems in Excel that have to be dealt with differently, in addition to any limts from MetaStock. ( Curiously Access does not have the same troubles as Excel when it comes to dates? It has some of its own issues that are different from Excel?! )
The 12:00:00 UT/GMT factor is to align the values with the MS date with the correct Julian / Gregorian data for that date:
For example:
The date is 24 May 2007. The JD for (let's pretend time is GMT/UT for simplicity):
00:00:00 24 May 2007 is 2454244.5
08:00:00 24 May 2007 is 2454244.83333
11:59:59 24 May 2007 is 2454244.99999
12:00:00 24 May 2007 is exactly 2454245
( neat pattern for 24/5 don't you think? 245 4 245 on 24/5? )
12:00:01 24 May 2007 is 2454245.00001
16:00:00 24 May 2007 is 2454245.16667
etc. (5dp)
I think(?) most people don't need the precision of the time of day, so I chose the arbitrary time for the JD as 12:00:00 GMT/UT so the indicator returns integer values only. It also means that after making the necessary corrections for Excel,
the JD for 24 May 2007 returned by the MS code (39226) is interpretted
correctly by Excel for the date (24 May 2007) Excel will show the time
as 00:00:00 so if users are concerned with attaining this level of precision with the data they export to Excel, they should add 0.5 (Personally, I am happy keeping the integer values. It also allows for the correct computation of the day of the week by taking the modulo 7, and this can be used to count weeks too. Computing the month, or month and year from the JD is a little harder.)
I suppose to be abolutely precise, individuals should also adjust for the time zone of the exchange for which the data is being presented? I didn't bother with that as I assume that most users will be happy to take the date as given in their data.
I subtract the epoch of 01 Jan 1900 for export to Excel purposes, or 01
Jan 2000 to keep the JD number small for "ease of use" in MS, but keep the "zero" epoch
for precision and checking of the algorithm against the USNO site. (If somone needs to amend the code to include 01 January 1800 epoch, the correction factor is 2378497)
If members need the precise JD to align their trading with the moon or stars etc, just add/subtract the proportion of the day in time as a decimal to/from the days as an integer. Or, let's put it like this: here is some code that members can take for themselves and manipulate as required to take the date-time data from MS into whatever application they like. If anyone needs any help implementing this, just ask, there are too many variables for me to cover in one piece of (meant to be simple : KISS) code.
Hope this helps
wabbit
"The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
Edsgar W. Dijkstra
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC C, 11 PRO w/QC & MDK
For custom MetaStock programming : http://www.wabbit.com.au
My SkyPE status : 
My SkyPE account : wabbit.com.au