Fix date/timestamp/interval output.

The javascript and HTML output doesn't want to deal with dates as number
of seconds since some epoch time, so handle the formatting correctly.