How do I get the date and time and input it into a field upon success?

How do I get the date and time and input it into a field upon success?

Every record in every table (form) has two fields (Added Time and Last Modified Time) that ZOHO Creator automatically updates when ever a Form is clicked on the Submit or Update Buttons, so you could elect to show these fields in your List View.  Refer the topic Display username and time for more information.

If you want to use your own field, 

a) Create a Date-Time field, for example, named TimeStamp

b) In the on Add -> on Success section and on Edit -> on Success sections of your Form, add the following script code, wherezoho.currentime is the Deluge system variable which returns the current time. The current time will be updated in the field named TimeStamp.

input.TimeStamp = zoho.currenttime;