0

In my front-end I have an Entry Form where I want the Current time to be submitted in an hidden field. Which works. But strangely enough it adds +1hour upon saving the entry.

In my form, this is the field which is submitted for the time:

In my form.twig :

<input id="ticketStartTime" type="time" name="fields[ticketStartTime][time]" value="{{ 'now'|time('short') }}"/>

In my generated HTML:

<input id="ticketStartTime" type="time" name="fields[ticketStartTime][time]" value="17:41">

The time my pc is 17:41. So the function does take the right time. The project is locally hosted.

Then, If I look in the entry it saved this time: 6:41 PM Which obviously is a one hour difference.

My craftCMS settings: - settings > general settings > timezone : UTC+1 (CET) - Europe/Amsterdam - settings > sites > mysite > language : en-NL - English (Netherlands)

Both settings are set up the way I want them to be set up.

Why and how does this go wrong? Thank you.

  • Silly question but, are you in Amsterdam? – Olivier Bon Feb 11 at 11:32
  • @OlivierBon Not in amsterdam, but in the netherlands. We share the same timezone across the whole country. – mike Feb 11 at 17:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.