News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

DateDiff procedure update

Started by GregL, September 25, 2008, 08:39:51 PM

Previous topic - Next topic

GregL

I happened to notice that the DateTime library procedure DayOfYear was not always
agreeing with the .NET Framework value for DayOfYear, sometimes they would
agree and sometimes they wouldn't. On further investigation I found the culprit was
the DateDiff procedure, which uses the FPU to subtract one DATETIME (QWORD)
from another. It was using the default rounding mode of the FPU which is round to
nearest or even. This procedure should not do any rounding, it should truncate. So,
I modified the DateDiff procedure to truncate the result. DayOfYear is giving the
correct result all the time now.

If anyone is using this code, you should update it. Just copy the DateDiff.asm file
into the \masm32\datetime directory and rebuild the library.

I sent hutch the new DateDiff.asm file.

[Edit] The attached file contains DateDiff.asm and DateTime.lib (if you don't want to have to rebuild the lib).


[attachment deleted by admin]