SF bug 661086: datetime.today() truncates microseconds.
On Windows, it was very common to get microsecond values (out of
.today() and .now()) of the form 480999, i.e. with three trailing
nines.  The platform precision is .001 seconds, and fp rounding
errors account for the rest.  Under the covers, that 480999 started
life as the fractional part of a timestamp, like .4809999978.
Rounding that times 1e6 cures the irritation.

Confession:  the platform precision isn't really .001 seconds.  It's
usually worse.  What actually happens is that MS rounds a cruder value
to a multiple of .001, and that suffers its own rounding errors.

A tiny bit of refactoring added a new internal utility to round
doubles.
1 file changed