<p>I suspect it might be your values. Try testing with this hard coded in and see if it works:</p>

<pre><code>&lt;input type="hidden" id="endDate" name="fields[endDate][date]" value="12/30/2017" /&gt;
&lt;input type="hidden" id="endTime" name="fields[endDate][time]" value="2:15 AM" /&gt;
</code></pre>

<p>I always reference what's on this <a href="https://straightupcraft.com/articles/craft-cms-field-guide-twig?view=input" rel="nofollow noreferrer">StraightUpCraft</a> guide, and I try to be as <em>exact</em> as possible to the examples. You can also just inspect date fields inside a saved entry in the CMS to see what the values look like and mimic that on the front end.</p>

CC BY-SA 3.0
2017-10-05T02:41:43.967Z
2017-10-05T02:41:43.967Z
Ryan
<p>I recently did this using a field called <code>expirDate</code>:</p>

<p><code>&lt;input type="date" name="expiryDate" id="expiryDate" class="form-control"&gt;</code></p>

<p>Can you give that a try?</p>

CC BY-SA 3.0
2017-07-06T14:11:58.500Z
How do you set value?
carlcs
CC BY-SA 3.0
2017-07-06T14:12:32.310Z
I can't rely on a date field type unfortunately as browser support is still spotty, and it wouldn't allow me to select the time either.
Matt Wilcox
CC BY-SA 3.0
2017-07-06T13:58:06.713Z
2017-07-06T13:58:06.713Z
Jan Henckens
<p>There are a number of answers on this forum for getting a front-end form to have a DateTime field that splits date and time into separate fields; It's not working for me.</p>

<p>If I strip back to absolute basics - hardcoded, as a test:</p>

<p><code>&lt;input type="hidden" id="endDate" name="fields[endDate]" value="2017-12-30 02:15:00" /&gt;</code></p>

<p>Works, and a date &amp; time is stored in the back-end field, displaying correctly.</p>

<p>But, if I try to split it so the date and time fields are separate (so that I can use a date picker on one and a select drop down on the other) - it doesn't save a value into the field. Even stripped back to hard-coded hidden fields...</p>

<p><code>&lt;input type="hidden" id="endDate" name="fields[endDate][date]" value="2017-12-30" /&gt;</code></p>

<p><code>&lt;input type="hidden" id="endTime" name="fields[endDate][time]" value="02:15:00" /&gt;</code></p>

<p>What am I doing wrong? The is the same format that works in the Craft back-end...</p>

<form>
front end date field format doesn't work? fields[dateField][date]
# front end date field format doesn't work? fields[dateField][date]

(Asked by: username_0 on 2017-07-06)

There are a number of answers on this forum for getting a front-end form to have a DateTime field that splits date and time into separate fields; It's not working for me.

If I strip back to absolute basics - hardcoded, as a test:

Works, and a date & time is stored in the back-end field, displaying correctly.

But, if I try to split it so the date and time fields are separate (so that I can use a date picker on one and a select drop down on the other) - it doesn't save a value into the field. Even stripped back to hard-coded hidden fields...

What am I doing wrong? The is the same format that works in the Craft back-end...

**Tags:** form


---

## 2 answers

### Answer by username_1 on 2017-10-05. Score: 1

I suspect it might be your values. Try testing with this hard coded in and see if it works:



I always reference what's on this StraightUpCraft guide, and I try to be as exact as possible to the examples. You can also just inspect date fields inside a saved entry in the CMS to see what the values look like and mimic that on the front end.


---

### Answer by username_2 on 2017-07-06. Score: 0

I recently did this using a field called `expirDate`:

Can you give that a try?

> **Comments:**
> **username_3**: How do you set value?  
> **username_0**: I can't rely on a date field type unfortunately as browser support is still spotty, and it wouldn't allow me to select the time either.  

---

