> Stupid thinking. By both of us
Well, you're half right.



According to the "original" Julian date formula, using today's date...
Code:
DD MON YYYY HH MM SS JULIAN DATE -- --- ---- -- -- -- --------------- 26 May 2000 00:00:00 = 2,451,690.5 (midnight) 26 May 2000 12:00:00 = 2,451,691.0 (noon) 26 May 2000 23:59:59 = 2,451,691.49999
This code:
Code:
DIM qTime AS LOCAL QUAD CoFileTimeNow qTime PRINT qTime \ 864000000000&&
So this code:
Code:
DIM qTime AS LOCAL QUAD CoFileTimeNow qTime PRINT (qTimeNow\%OneDay)+2305814&
Code:
DIM qTime AS LOCAL QUAD CoFileTimeNow qTime PRINT (qTimeNow\%OneDay)-94187&
Returning to CoFileTimeNow... I guess I'll call a value derived directly from CoFileTimeNow an "MS Julian" date. I refuse to call everthing since 1601 "the Microsoft Era".

Since 1 January 1601 was not a Sunday, simply performing a MOD 7 operation will not produce the correct day of the week as I'd said. Use this code instead:
Code:
DIM qTime AS LOCAL QUAD DIM qMSJulian AS LOCAL QUAD CoFileTimeNow qTime qMSJulian = qTime \ 864000000000&& PRINT "Today is day "+FORMAT$((qMSJulian+1) MOD 7)+" of the week."
-- Eric
P.S. Here is a link to the U.S. Naval Observatory's Julian Date Calculator:
http://aa.usno.navy.mil/AA/data/docs/JulianDate.html
It's interesting to note that even this authoritative reference says "the day of the week can be obtained from the remainder of the division of the Julian date by 7" but this is apparently not correct. Doing that with today's date yields 4, not 5 as it should. Time to write them an email...
------------------
Perfect Sync: Perfect Sync Development Tools
Email: mailto:[email protected][email protected]</A>
[This message has been edited by Eric Pearson (edited May 26, 2000).]
Leave a comment: