Fix datetime logging