Add DateTime and location upon successful form submission

Add DateTime and location upon successful form submission

I am doing a check-in and check-out form.
How can I automatically add the current datetime to the record, upon submission of a form?
And is it possible to also add the location of the person submitting the form?