Check prev_datetime whether it is not None