innreport's ConvDate
Russ Allbery
rra at stanford.edu
Mon Dec 15 01:40:21 UTC 2008
Alexander Bartolich <alexander.bartolich at gmx.at> writes:
> The date parsing code in innreport checks neither leap years nor
> daylight saving. Incorrect handling of 29th of February loses the
> report of a whole day. This must be fixed and is fortunately easy to
> fix. However, I'm not so sure about consequences and cure of the second
> issue. Probably the 25th hour can be recognized by checking
> non-sequential time stamps.
Thanks, filed as ticket #90.
For daylight savings time, yeah, we'd probably have to do something like
that, and that's a mess. The best solution would be to switch to a
timestamp format that either included time zone information or always used
UTC, but that's of course a big change.
> Anyway, for documentation purposes I post a benchmark comparing
> innreport's current implementation (ConvDate), my version using a hash
> (ConvHash), and Perl's Time::Local::timelocal.
Perl's version is painfully slow since it stats /etc/localtime on each
conversion. Looking at it in an strace is kind of frightening.
--
Russ Allbery (rra at stanford.edu) <http://www.eyrie.org/~eagle/>
Please send questions to the list rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
More information about the inn-workers
mailing list