set NULL instead of empty string if no DateTime object is given