Add format_time() to make the times human readable.

This should be part of core, so other clients can format times nicely.