# How to add current date and time to custom field in Update contact action

**URL:** <https://forum.mautic.org/t/how-to-add-current-date-and-time-to-custom-field-in-update-contact-action/14924>\
**Category:** Product Support\
**Created:** [June 23, 2020, 8:54pm UTC](https://forum.mautic.org/t/how-to-add-current-date-and-time-to-custom-field-in-update-contact-action/14924 "2020-06-23T20:54:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![schubert](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/schubert/32/2753_2.png) [@schubert](https://forum.mautic.org/u/schubert)\
**Post date:** [June 23, 2020, 8:54pm UTC](https://forum.mautic.org/t/how-to-add-current-date-and-time-to-custom-field-in-update-contact-action/14924/1 "2020-06-23T20:54:58Z")

</div>

**Your software**  
My Mautic version is: 2.16.0 - Docker Hub Install  
My PHP version is: 7.1.33

**Your problem**  
My problem is:

I want to fill a custom field (Date/Time) with current date and time in a campaign, when the contact has clicked on the the link (Visits a page) in the welcome mail. How is the Mautic way to do this? The trigger works.

I indent to document the contact opt in date thereby. GDPR/DSGVO you know. 🙂

These errors are showing in the log: -

Steps I have tried to fix the problem:

I setup an Update contact step in the campaign builder, but I cannot setup a relative date to fill in. I have found the idea to setup a database trigger, but I dislike this idea, as its not visible in the campaign.

Is there a way to solve this?

Thank you for your help.

Best regards, Mario

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [June 24, 2020, 10:07am UTC](https://forum.mautic.org/t/how-to-add-current-date-and-time-to-custom-field-in-update-contact-action/14924/2 "2020-06-24T10:07:23Z")

</div>

Hi Mario,

I am not aware of a solution - thus the proposed feature [Dynamic ("Calculated") Values in Campaign Actions](https://forum.mautic.org/t/dynamic-calculated-values-in-campaign-actions/13736)  
What we do as a workaround is to store the date&time when the form has been sent ([https://www.leuchtfeuer.com/en/mautic-know-how/mautic/dynamic-values-in-mautic-forms-date-time-url](https://www.leuchtfeuer.com/en/mautic-know-how/mautic/dynamic-values-in-mautic-forms-date-time-url))

Best,  
Ekke

* * *

_Subscribe to the **Mautic Podcast** at [www.Mauticast.com](http://www.Mauticast.com) - and let me know what topics or interviews you would like to hear!_  
_(German version at [www.Mauticast.de](http://www.Mauticast.de))_
