Fix datetime formatting