Improves date formatting (don't output time when not needed)