oleaut32: Fixed time outputing for dates before 1899 in VarBstrFromDate.

This commit is contained in:
Piotr Caban 2013-02-22 18:43:26 +01:00 committed by Alexandre Julliard
parent b6a7cc9112
commit 8f7d1ed520
2 changed files with 2 additions and 1 deletions

View File

@ -4951,6 +4951,7 @@ static void test_VarBstrFromDate(void)
BSTR_DATE(365.25, "12/30/1900 6:00:00 AM");
BSTR_DATE(1461.0, "12/31/1903");
BSTR_DATE(1461.5, "12/31/1903 12:00:00 PM");
BSTR_DATE(-49192.24, "4/24/1765 5:45:36 AM");
todo_wine { BSTR_DATE(-657434.0, "1/1/100"); }
BSTR_DATE(2958465.0, "12/31/9999");

View File

@ -6619,7 +6619,7 @@ HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR* pbst
if (whole == 0.0)
dwFlags |= VAR_TIMEVALUEONLY;
else if (partial < 1e-12)
else if (partial > -1e-12 && partial < 1e-12)
dwFlags |= VAR_DATEVALUEONLY;
}