Make time formatting DRYer.