We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23344
    • 31 Posts
    Looking through the documentation I only see tags for referencing times in a document’s lifecycle. I need to put a timestamp in a form submission. I created a hidden field and was trying to inject a value, but as it only wants to refer to the contact page document the value is never current.

    What can I do?

    Using the current Revo release.
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      You could make a simple Snippet that prints the current time in whatever format you want, then put it inside your form field, e.g.

      <input type="hidden" name="time_submitted" value="[[!getCurrentTime]]" />


      Where the Snippet would be named "getCurrentTime" and would contain something like:

      return date('Y-m-d');
        • 15083
        • 697 Posts
        return time();

        :)
          • 32316
          • 387 Posts
          there are a bunch of php time functions depending on what you need.

          for example another is getdate() which returns an array of time values as well as the number of ’seconds since the Unix Epoch’ which what time() provides