I have a Data Extension with an "Opt in" date field and created a Smart Capture form to capture other data (Name, email etc.). I wish to populate the "Opt in" field with the current date every time the form is submitted. How can I achieve this?
2 Answers
I ended up using AmpScript:
%%[
var @localDate
set @localDate = SystemDateToLocalDate(Now())
]%%
<input value="%%=v(@localDate)=%%" />
I would do the same as you but I would also add this format function to change it to date format (from Date Time):
%%[ var @localDate set @localDate = Format(SystemDateToLocalDate(Now()),"MM/dd/yyyy")
]%%
RESULT EG: 04/22/2021