Create date/time from string via form I'm using the wonderful A&amp;M form plugin to create a form on my site, and I have 3 dropdowns for the user's birthday: month, day, and year.  Currently, I have it set up so that when the form submits, those values get put into a matrix field when logged in the form submissions entry in the CMS.  I would prefer to have it put into a date/time field though, but I'm unsure how to do it.

This is the code in my form:

&lt;label&gt;Birthday&lt;/label&gt;
&lt;input type="hidden" name="fields[birthday][new1][type]" value="date"&gt;
&lt;div id="birthday"&gt;
    &lt;select name="fields[birthday][new1][fields][month]"&gt;
        &lt;option selected="selected" value=""&gt;M&lt;/option&gt;
        {% for i in 1..12 %}
            &lt;option value="{{ i }}"&gt;{{ i }}&lt;/option&gt;
        {% endfor %}
    &lt;/select&gt;
    &lt;select name="fields[birthday][new1][fields][day]"&gt;
    &lt;option selected="selected" value=""&gt;D&lt;/option&gt;
        {% for i in 1..31 %}
            &lt;option value="{{ i }}"&gt;{{ i }}&lt;/option&gt;
        {% endfor %}
    &lt;/select&gt;
    &lt;select name="fields[birthday][new1][fields][year]"&gt;
        &lt;option selected="selected" value=""&gt;Year&lt;/option&gt;
        {% set startYear = now.year - 15 %}
        {% set endYear = now.year - 110 %}
        {% for i in startYear..endYear %}
            &lt;option value="{{ i }}"&gt;{{ i }}&lt;/option&gt;
        {% endfor %}
    &lt;/select&gt;
&lt;/div&gt;


In this case, "birthday" is my matrix field handle and "date" is the block type handle.  "month", "day", &amp; "year" are obviously the field handles within the matrix field.

There's nothing in the docs. I understand a date/time field doesn't produce an object like a matrix field, but I can't think of a solution of how to convert it.
Ok, I figured it out. First, to solve the birthday input problem, I used javascript to gather the values of each individual date dropdown and assemble them into a hidden text input that would be what passes in the datetime value to Craft.  No problem.

However, the datetime formatting tripped me up because there are two posts here that had the formatting differently.

The formatting needs to exactly match the example shown here on StraightUpCraft under the date row.  So a date value like 2014-06-24 does not work; it needs to be 06/24/2014. Likewise, the time value of 23:30:00 does not work either; it needs to be 11:30 PM.

My final code looks like this after the javascript fills in the date value. Since it's a birthday, the 6pm time is just hardcoded in.

&lt;input type="text" size="10" name="fields[birthday][date]" value="02/24/1985"&gt;
&lt;input type="text" size="10" name="fields[birthday][time]" value="6:00 PM"&gt;


Extra note for those using localized sites: you need to submit the date and time exactly how Craft formats them for each localization. For example, "6/24/2016" would be the acceptable date format for the U.S., but it will need to be "24.6.2016" when submitted on the German version of that page. You can output the formats dynamically in Craft using the translations filter:

&lt;input type="text" size="10" name="fields[fieldHandle][date]" value="{{ now|date('Date Input Format'|t) }}"&gt;
&lt;input type="text" size="10" name="fields[fieldHandle][time]" value="{{ now|date('Time Input Format'|t) }}"&gt;


And then in your translations files put something like:

"Date Input Format" =&gt; "d.m.Y",
"Time Input Format" =&gt; "G:i",


etc