update function date and date_update to support external date