Fixed datetime wrapping