Update a field on a node after hitting save
Depending on your exact usage, you'd want to use either

1) hook_node_presave - Called on any node being saved (inserted or updated). see here

2) Attach a submit handler to the form: Allows to change the form's values before the submit is completed.