Time formatting for history