Capture the Date and Time the Submit button is clicked - and putting that in the notification email?

Like the subject says, is there a way to capture the date and time that the submit button is clicked and add that bit of data to the information being sent in the notification email? Not real savvy here with a lot of this stuff, so be gentle, lol. :blush:

Yes, you can use either {date_mdy} or {date_dmy} - youā€™ll find both when you click on the ā€œMerge Tagsā€ icon on the far right side of the notification message body field, or you can just type it in like shown.

Okay, I found that about twenty minutes before you responded, Trisha ā€“ is there a corresponding field for the time? I hope? I donā€™t see anything in the dropdown list so hoping itā€™s something that can be typed in? :pray:

image001.jpg

Well, theoretically you could hook into one of the notification filters to modify the output of that merge tag to use a different PHP date() format that includes a timestamp, but thatā€™s a bit over my head, so hopefully one of the developers will offer a better solution for you.

Iā€™d also encourage you to submit a request to include timestamp in a Merge Tag option for a future update.

Iā€™m sure youā€™re aware that the email itself has a timestamp that would - in most cases - be within a minute of the form submission time since those are generally sent immediately, but I can easily think of many uses where youā€™d want that in the body of the email alsoā€¦so it seems like a reasonable request.

1 Like

Yeah, that first thing is over my head too, lol. :smile:

Iā€™ll submit a request for it and hope the developers see this and have a solution.

Yeah, the email datetime stamp is there and is quasi working for what Iā€™m doing but itā€™s clunky and slows my whole process down to go back and look for it. Iā€™m glad someone else thinks itā€™d be useful in other cases. :blush: Thanks for your help and ideas, Trisha!

Iā€™m late to the game here, but you can use the gform_replace_merge_tags filter to give yourself an {entry_time} merge tag, as shown in example 2 here:

Thanks Chris - I was actually able to use the merge tag {entry:date_created} by copying and pasting that tag from that entry into the notification and that works great, mostly. However, itā€™s four hours ahead of the actual time (guessing itā€™s on coordinated universal time?) and comes through as a link. Itā€™s funny that the link goes to the {entry} Merge Tag - Gravity Forms Documentation page and if you take the link out? It doesnā€™t work. :neutral_face:

So, while not entirely back to square one, itā€™s a little bit of a setback. So, were I able to use that #2 entry you mentioned, a) where do I put that code and 2) how can I modify it to subtract four hours from the time? (if you know)