Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -428,11 +428,11 @@ return [element autorelease]; } - (uint32_t)microsecond { - return (uint32_t)rint((_seconds - floor(_seconds)) * 1000000); + return (uint32_t)((_seconds - floor(_seconds)) * 1000000); } - (uint8_t)second { GMTIME_RET(tm_sec) Index: tests/OFDateTests.m ================================================================== --- tests/OFDateTests.m +++ tests/OFDateTests.m @@ -32,11 +32,11 @@ TEST(@"+[dateWithTimeIntervalSince1970:]", (d1 = [OFDate dateWithTimeIntervalSince1970: 0])) TEST(@"-[dateByAddingTimeInterval:]", - (d2 = [d1 dateByAddingTimeInterval: 3600 * 25 + 5.000001])) + (d2 = [d1 dateByAddingTimeInterval: 3600 * 25 + 5.000002])) TEST(@"-[description]", [[d1 description] isEqual: @"1970-01-01T00:00:00Z"] && [[d2 description] isEqual: @"1970-01-02T01:00:05Z"]) @@ -52,11 +52,11 @@ TEST(@"-[compare:]", [d1 compare: d2] == OF_ORDERED_ASCENDING) TEST(@"-[second]", [d1 second] == 0 && [d2 second] == 5) TEST(@"-[microsecond]", - [d1 microsecond] == 0 && [d2 microsecond] == 1) + [d1 microsecond] == 0 && [d2 microsecond] == 2) TEST(@"-[minute]", [d1 minute] == 0 && [d2 minute] == 0) TEST(@"-[hour]", [d1 hour] == 0 && [d2 hour] == 1)