<p>Thank you everyone for your suggestions - I need to keep reading/digging more to fully understand, but it seems that it was just a formatting issue.</p>

<pre><code>{{ block.startDateTime|date('H:i:s') }}
</code></pre>

<p>Renders the correct time on the template.</p>

CC BY-SA 3.0
2017-06-04T15:01:29.467Z
2017-06-04T15:01:29.467Z
Damon
<p>I am using <a href="https://github.com/jonthornton/jquery-timepicker" rel="nofollow noreferrer">jQuery-timepicker</a> to give the user an option to pick a starting time and ending time.</p>

<p>My init looks like this:</p>

<pre><code>$('.timepicker').timepicker({
    scrollDefault: 'now'
});
</code></pre>

<p>When I save the entry as attached (screen below) it is displaying the time + 6 minutes.
<a href="https://i.sstatic.net/QtsiI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QtsiI.png" alt="enter image description here"></a><a href="https://i.sstatic.net/Ujqhz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ujqhz.png" alt="enter image description here"></a></p>

<p>My template looks like this:</p>

<pre><code>&lt;input type="text" name="fields[myTimes][{{ block.id }}][fields][startDateTime][date]" class="form-control datepicker" value="{{ block.startDateTime|date('m/d/Y') }}"&gt;

&lt;input type="text" name="fields[myTimes][{{ block.id }}][fields][startDateTime][time]" class="form-control timepicker" value="{{ block.startDateTime|date('h:m') }}"&gt;

&lt;input type="text" name="fields[myTimes][{{ block.id }}][fields][endDateTime][time]" class="form-control timepicker" value="{{ block.endDateTime|date('h:m') }}"&gt;
</code></pre>

<p>When I save my form, everything looks like it is saving correctly, its always +6 min. I'm not sure what I am doing wrong.</p>

<p>Thank you for any suggestions!</p>

<p><strong>EDIT</strong></p>

<p>Here is another example. I have saved for 9:00PM - 10:00PM
It saves correctly, but the template shows +6 still. :)<a href="https://i.sstatic.net/Q396d.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Q396d.png" alt="enter image description here"></a><a href="https://i.sstatic.net/qOS9r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qOS9r.png" alt="enter image description here"></a><a href="https://i.sstatic.net/obz5y.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/obz5y.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2017-06-03T19:52:55.173Z
How fascinating. Is your system clock off by 6 minutes? (Wild guess.) Wondering if this happens in more than one environment...
Matt Stein
CC BY-SA 3.0
2017-06-04T02:30:11.893Z
Strange huh? It doesn't appear that it's the clock. It's almost like it's at the template level - which is why I thought for sure it's something i'm doing (or not doing).
Damon
CC BY-SA 3.0
2017-06-04T03:34:42.030Z
Yeah... that's super weird. No idea why that would happen, but definitely something xDebug would help figure out.
Brad Bell
CC BY-SA 3.0
2017-06-04T03:43:20.800Z
Not to be a broken record, but are you definitely seeing this in more than one environment? I assume you would've mentioned if you were seeing six-minute page load times.
Matt Stein
CC BY-SA 3.0
2017-06-04T07:17:46.050Z
Start time seems to get converted to AM, so there might be some formatting involved.
megatrond
CC BY-SA 3.0
2017-06-04T07:19:24.790Z
We're also in June, which is the sixth month, so m vs M in the formatting? Or the other way around? One is the month number and the other is minutes, can't remember which is which
megatrond
<templating><datetime>
How can I correctly set the time of a dateTime field from a front-end form?
# How can I correctly set the time of a dateTime field from a front-end form?

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

I am using jQuery-timepicker to give the user an option to pick a starting time and ending time.
My init looks like this:
$('.timepicker').timepicker({
    scrollDefault: 'now'
});

When I save the entry as attached (screen below) it is displaying the time + 6 minutes.

My template looks like this:






When I save my form, everything looks like it is saving correctly, its always +6 min. I'm not sure what I am doing wrong.
Thank you for any suggestions!
EDIT
Here is another example. I have saved for 9:00PM - 10:00PM
It saves correctly, but the template shows +6 still. :)

**Tags:** templating, datetime
> **Comments:**
> **username_1**: How fascinating. Is your system clock off by 6 minutes? (Wild guess.) Wondering if this happens in more than one environment...  
> **username_0**: Strange huh? It doesn't appear that it's the clock. It's almost like it's at the template level - which is why I thought for sure it's something i'm doing (or not doing).  
> **username_2**: Yeah... that's super weird. No idea why that would happen, but definitely something xDebug would help figure out.  
> **username_1**: Not to be a broken record, but are you definitely seeing this in more than one environment? I assume you would've mentioned if you were seeing six-minute page load times.  
> **username_3**: Start time seems to get converted to AM, so there might be some formatting involved.  
> **username_3**: We're also in June, which is the sixth month, so m vs M in the formatting? Or the other way around? One is the month number and the other is minutes, can't remember which is which  

---

## 1 answers

### Answer by username_0 on 2017-06-04. Score: 1 | Accepted answer

Thank you everyone for your suggestions - I need to keep reading/digging more to fully understand, but it seems that it was just a formatting issue.
{{ block.startDateTime|date('H:i:s') }}

Renders the correct time on the template.


---

