Round microseconds when parsing ISO 8601 date-time string
commita91bd9e8881b5b56b7379bb42923828c3eeb8c1b
authorPetr Písař <petr.pisar@atlas.cz>
Thu, 1 Jan 2015 14:49:15 +0000 (1 15:49 +0100)
committerPetr Písař <petr.pisar@atlas.cz>
Thu, 1 Jan 2015 15:01:05 +0000 (1 16:01 +0100)
tree24d98e890678a215428180bba401a6c71a4bc179
parent971c7a7b4af8664bc402f76f9e43a895c296e2bb
Round microseconds when parsing ISO 8601 date-time string

The string is converted into timeval structure which has microseonds
resolution. Currently, the server does not use higher resolution, but
the ISO 8601 has virtually unlimited precision.

Therefore this patch implements rounding so that submicroseconds are
taken into account too. The rounding algorithm is round half up (or
round half away from zero in case of negative dates, but these are not
supported properly either.), i.e. 0.5 µs gets rounded to 1 µs.
src/isds.c
test/offline/isds-timestring2timeval.c