Move datetime formatting to helper.

Eliminates duplication in the models.