Hi,
I have created on a webform a date/time element as below:

I want when the webform is launched/opened, the webform date/time element to be equal by default to the current date of the website.
I have tried to use the default value option available under the advanced section on the edit element page:

but i cannot find a way to set the default value of the date/time field equal to the current date/time of the website.
also I tried to use token in this field with no success.
Solution:
If you create a date field on any content type (or ex: article), on the edit field page you will have the below option which is very handy.

Thank you,
Comments
Comment #2
jrockowitz commentedThe help text was broken. The attached patch fixes this issue.
You can enter 'today' as the default value.
Comment #3
jrockowitz commentedComment #4
c.e.a commentedActually the patch fixed the help text but i believe we still have a minor problem here !
After i set the default value to today,
the date field is displaying today's date but the time field isn't.
However, if you hover over the time field, you will notice that the time is displayed correctly as today's time but the field value isn't.
Comment #5
jrockowitz commentedTry using
nowas the default value.Comment #6
c.e.a commentedIt is working as expectes with the default value as "now"
It will be helpful for other users if you can add it to the help text as well.
Thank you for your quick reply,
Comment #7
c.e.a commentedIt is working as expected with the default value set to "now"
It will be helpful for other users if you can add it to the help text as well.
Thank you for your quick reply,
Comment #8
c.e.a commentedI also noticed that the default value work only on the webform in view mode and not in edit mode.
Meaning:
if you try to edit an existing submission where the date/time value was not filled in from the beginning, the default value won't work !!
Any workaround for this subject !?
The idea is when i edit an existing submission and the date/time value still emty, i want to be automatically filled in by the default value.
Thank you,
Comment #9
jrockowitz commentedYou would have to write custom code to populate the default value for existing submissions.