improve message date handling and formatting