Fix bug in date formatting
reduce overhead