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)