Improve datetime formatting