The code would be more readable if you cached the time of day (boost::posix_time::time_duration(hour,minute,second)) in a variable like you cached the goal_date.