Move date formatting to update function